I read some time ago about a way to comment a css block in a such way that you only need to remove one end of the comment character set in case you want to uncomment the block later.
But I can't remember how it was done :( Maybe someone here does know :)
To comment in CSS, simply place your plain text inside /* */ marks. This tells the browser that they are notes and should not be rendered on the front end. You can also format them as multi-line comments: /* These words…
-- --> to hide CSS from older browsers, although this is not recommended. As with most programming languages that use the /* */ comment syntax, comments cannot be nested. In other words, the first instance of */ that follows an instance of /* closes the comment.
To “comment out” a button — or any HTML element— simply wrap the element in the< ! ╌ ╌> tags. Everything between those tags will not be shown on the front end.
/* * /
.class { color: #ffa; }
/* */
The space between the *
and /
in the first line causes the comment block to be un-closed until the final, paired, */
on the last line.
If you close that space then the .class
css is un-commented.
For languages such as php and JavaScript the opening /*
in the last line can be replaced with a //
as a single-line comment:
/* */
$name = $_POST['first_name'] . " " . $_POST['last_name'];
// */
I think it's called 'lazy-commenting' or something, but I'm not sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With