-
Book Overview & Buying
-
Table Of Contents
LESS WEB DEVELOPMENT COOKBOOK
By :
Commenting your code will help you and others to better understand the code. If you or someone else have to change your code, maybe after a long period since the code was written, the comments should clarify what a block of code does and why it was added in the first place.
In this recipe, you will need a randomly chosen Less file without a comment. If you don't have such a file, you can create one yourself.
Both Less and CSS allow you to use block-level comments that start with /* and end with */. The following code will show you an example of a block-level comment:
/* * Example code for Less Cookbook * copyright 2014 by Bass Jobsen */
In contrast to CSS, Less allows single-line comments. A single-line comment starts with //, as shown in the following example code:
@menuColor: red; //sets the background color for the menu
Note that you cannot nest two or more block-level comments...
Change the font size
Change margin width
Change background colour