You should comment on HTML and CSS code
Insert CSS comment - comment out CSS areas
As with HTML, we can also comment on our CSS instructions or comment out areas in our CSS instructions (to put it bluntly, switch them off or temporarily deactivate them).
Structure of the CSS comment
The corresponding instruction differs from the HTML comment. The CSS comment is introduced with and followed by. The now enclosed is ignored by the browser:
In the following example for the foreground and background color, we switch off the background color:
The 2 functions of comments
The possibility of commenting out or commenting offers us the following 2 possibilities.
- Commenting on our CSS code
- Comment out areas, for example to save them for later or to test something
Insert CSS comments
If we want to add a comment, we can do so directly after our code. In the following example the hex code is commented:
Commenting out areas
We can comment out individual lines and thus play with our CSS code while learning CSS and thus learn to better understand how CSS works.
Or several lines:
In the above example, ours no longer has any CSS instructions. We could also comment out the entire selector:
TIP: Use shortcuts in the editor!
Most editor shortcuts for commenting out areas in CSS allow you to comment out areas very quickly.
For the editor bracket used in the course, the procedure is:
- Mark the code to be commented out (if you only want to comment out one line, then it is sufficient to place the cursor in the line
- Shortcut Windows + +
- Shortcut Mac ++
If you want to "activate" something that has been commented out, simply do the above again. Place cursor in line (if only one line is commented out), otherwise mark the lines. Then press the appropriate shortcut for your operating system.
Recommend • Social Bookmarks • Thank you
If you find a bug, please let us know (no matter if typographical or content-related error).
With a mouse Mark the faulty point and take over with the following button:
- What is the particle size distribution curve
- Which organism has the largest cell cells?
- How did President Trump unite the country
- Are there really ghosts or not
- What is Apache Nutch
- How long is an apostille valid?
- How many languages are there in LOTR
- Which MBA programs are best for women
- What does dreams mean
- Real beauty can change the world
- What is your favorite tank and why
- What is cell phone architecture
- Why is kindergarten an untranslatable English word
- A balance sheet can be zero
- What trouble did Walter White have
- What is Alan Jackson's most successful song
- Do borderline personalities feel anything
- What are some campsites in Hampi
- How was the Howrah Bridge built
- What's your best ballet advice
- What would the perfect car do
- How do websites and blogs make money?
- Which bank processes direct deposits the fastest?
- Why is America a tyrant