IE applying a CSS rule to an element that doesn't qualify for that respective rule... ( 6 Views )
-
IE managed to confuse me once again
If you look at www.writers-summit.com/index.php in Mozilla you'll see the layout as I want it (except the yellow colour - it merely is there to quickly point out the mistake), if you look at it in IE you'll see that the whole "Site News" block is yellow.
Anyone know what I'm missing?
(fatma, Saint Vincent and the Grenadines)
Try running this through a browser:
Code:
<style>
div { background: silver; margin: 1em; padding: 1em; }
div .red { background: red; }
div .yellow { background: yellow; }
div .yellow.red { background: pink; }
div .red.yellow { background: orange; }
</style>
<div>
<div class="red"> Red </div>
<div class="red yellow"> Orange </div>
<div class="yellow"> Yellow </div>
</div>
That should clear it up.
For people too lazy to put that into an HTML file: In IE, "Red" goes Pink, "Orange" goes Orange, and "Yellow" goes Orange too.
Seems like IE applies styles to both .yellow divs when you use .red.yellow, but not to .red itself.
Douglas
(derya, Bermuda)
Interesting, so IE cannot deal with multiple class declarations?
(furkan, Brunei Darussalam)
as usual...IE's flawed CSS support ? never...
i'm often surprised at how surprised people are at this...
(merve, Iceland)
I'm not at all surprised, but merely hoping someone pops by with a solution...
(alptekin, Tunisia)
Quote:
Originally Posted by LeeCHeSSS
I'm not at all surprised, but merely hoping someone pops by with a solution...
|
As you only have one class="item alt", I suggest you change it to class="itemalt" and add change your selectors for ".item" to ".item, .itemalt" and the same for .alt. Will solve your problems, and doesn't really affect readability.
hth,
Douglas
(dogukan, Norfolk Island)
Related Topics ... (or search in 1.720.883 topics !)
css rule not applying to <noscript> tag on ie (2) css rule for th element not working (2) applying extra rule to all other rules (11) applying text-align rule to html tag (9) only apply rule if following a certain element. (3) stumped - rule for parent element? (4) can a given field have a rule for an id and a rule for a class (3) * css rule? (7) css rule for xp/sp2 only? (2)
copyright © 2007-2031 Pfodere.COM ( 4 Pfoyihuee Online )
|