Commenting Out Large Section that Includes Comments

this one:

but i may have misunderstood :slight_smile: yes, it’s closing the commented part, but it seems that it doesn’t always work as you describe it: for closing also the comment element too, if you have white space between – and >, like this – > (or like in your example <– comments <!-- coments >), it’s not always doing that, although it should, if only by specs. only FF and Op seems to do so (and sometimes only FF). so we’re back to square one: it’s not working the same in all browsers.

it seems to me that using the <style> element to wrap parts of your code as commented, although it may seem strange and obviously a wrong use, may be the cleanest way. taking advange of the fact that the content of it does not render it’s beneficial. drawbacks: it’s used outside its scope (the head element), has no html logic, can be overlooked as it is the case of <==, ==> because it’s easier to implement. probably another html element whose content also does not render could be used, but as far as i lingered upon the idea, <script> didn’t appealed to me.


Wrapping the region with another element is pretty cool. I’d use a div of class “comment”, then in the stylesheet have .comment {display: none;}. Of course it fails in a non css aware browser. :shrug:



thanks :slight_smile:

that is why i’ve though of <style>, it will work anyway: CSS or not, JS or not, with minimum impact on the page performance, and because its content does not render. of course, you sacrifice a couple of things when using this solution, but from all the dirty tricks, i think it’s the fastest and provides a clearer way of doing and undoing, with less to worry about :slight_smile: