Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<!-- in a <style> declaration - What are it's different uses and meanings? [duplicate]

Tags:

css

Possible Duplicate:
Commenting out stylesheets in HTML documents to support older browsers

I'm trying to understand the purpose for the comment when doing certain types of styling. I have seen it before in instances of IE conditional styling.

Here is one I saw this morning:

<style tyle="text/css">
<!--
@page { size:8.5in 11in; margin: 2cm }
-->
</style>

What purpose does this serve here, and also when is the other uses for this, and when are they appropriate. Does CSS not read the comment, or does it mean something completely different in CSS?

like image 454
Nicholas Decker Avatar asked Dec 09 '25 21:12

Nicholas Decker


1 Answers

It is a HTML comment as intended to ensure backwards compatible with "ancient browsers" that don't support CSS.

Don't bother with it!

like image 108
ColinE Avatar answered Dec 12 '25 12:12

ColinE