CSS IE quirk

honestrosewater

Gold Member
2,072
4
Going with the idea that every bit counts, in situations like:
h1, h1.box {
font-size: 1em;
color: #0033cc;
letter-spacing: 0.05em;
}
h1 {margin: 1em;}
h1.box {margin: .2em .5em;}
Can I reduce it to:
h1 {
font-size: 1em;
color: #0033cc;
letter-spacing: 0.05em;
margin: 1em;
}
h1.box {margin: .2em .5em;}
without causing any browser compatibility/bug problems?

In short, will classes and ids *always* win out over nonclasses and non ids, for all elements (div, p, etc.) and settings (position, width, etc.)? Or is there another reason I should despise IE?
Thanks a bushel :biggrin:

Happy thoughts
Rachel
 
CSS is read procedurally, so whatever line was read last will stick unless there is a !important attribute attached.
 

Want to reply to this thread?

"CSS IE quirk" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top