cross browser - Can we use CSS 2.1 selectors in practice? -


The main criminal course behind this question is IE6, (almost) all agree that the website should support IE6 because it is used. More than 15% of visitors ()

If IE6 does not support CSS 2.1, can we use CSS 2.1 selectors in our stylesheet? I give an example:

  & lt; Body & gt; & Lt; Div class = "header" & gt; & Lt; / Div & gt; & Lt; Div class = "content" & gt; & Lt; H1 & gt; Title & lt; / H1> & Lt; P & gt; 1st paragraph & lt; / P & gt; & Lt; P & gt; The second paragraph & lt; / P & gt; & Lt; / Div & gt; & Lt; Div class = "footer" & gt; & Lt; / Div & gt; & Lt; / Body & gt;  

My CSS can look like this:

  body & gt; Div (width: 760px;} / * header content and footer = 760px wide * / h1 + p {margin-top: 5px;} / * h1 tag should be the first paragraph a small margin * /  

But IE6 will not be able to understand it, so in order to get the browser compatible in any way, I should write it like this:

  .header, .content,. Footer {width: 760px; }  

And perhaps I have to give the first paragraph a few class names and it must be defined in my CSS as well. I can make a specific person defining those rules, but it seems like it is doubly (and even then the first paragraph does not need the name of the class) ...

If you are serious about IE6 100% support then you should use CSS which will not work with it. One reason for using those fancy selectors is that you make your life easier, but if you want to rewrite them for IE6, then this will not make your life easier. Finally, like fancy selectors, it may be that they all avoid together.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -