Jump to content

How to comment out inner CSS lines inside a larger outer comment block?


pstein

Recommended Posts

Assume I have the following CSS rule in a *.css file:
 

.foobar {
  aaa: 10px;
  /*  blah blah blah comment */
  bbb: 15px !important;
  ccc: something !important; }

It works.

 

Now I decide (e.g.for testing purposes) to disable the whole .foobar rule without deleting it:
 

/*
.foobar {
  aaa: 10px;
  /*  blah blah blah comment */
  bbb: 15px !important;
  ccc: something !important; }
*/

 

Unfortunately the inner comment end tag */ closes the outer comment block as well.

How can I avoid this without deleting the inner comment block?

Maybe there is second comment tag like "//" in Java which declares the remainder of the line right of it as comment

 

Edited by pstein
Link to comment
Share on other sites

You cant have a nested comment within a comment, all you can do is close the beginning comment tag before nested comment, then a opening comment tag after nested comment for the end comment tag.

/*
.foobar {
  aaa: 10px;
  *//*  blah blah blah comment *//*
  bbb: 15px !important;
  ccc: something !important; }
*/

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...