HighDots Forums  

IE sucks (or maybe it's me): class selector fails

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss IE sucks (or maybe it's me): class selector fails in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DuncanIdaho
 
Posts: n/a

Default IE sucks (or maybe it's me): class selector fails - 04-23-2008 , 08:12 AM






Hello

IE 7.0.5730.11
Opera 9.27
Firefox 2.0.0.14

I have the following in my stylesheet

..navbody a{
text-decoration: none;
color: rgb(68, 146, 181);
}

a.leaf{
text-decoration: none;
color: rgb(254, 100, 253);
font-size: 0.75em;
}

AJAX produces the following html

<div id="navmenu">
<div id="menuheader">
Browse Catagories
<br/>
<a href="javascript:getMenuUpdate('-1')">collapse menu</a>
</div>
<div id="menudiv" class="navbody">
<span>
<a href="javascript:getMenuUpdate('1')">
</a>
<a class="node" href="javascript:getMenuUpdate('1')">Jewellery</a>
</span>
<br/>
<span>
<img border="0" src="images/navspacer.jpg"/>
<a class="leaf" href="products?catagoryId=1:1">Earrings</a>
</span>
.... etc

in Opera and Firefox the anchor with class 'leaf' is rendered in a
smaller pink font (nice!) in IE it's rendered in the same sized light
blue as other stuff in the navbody

Are class selectors supposed to work when output is dynamically
generated ? or is this another 'feature' of IE

TIA

Idaho

Reply With Quote
  #2  
Old   
Steve Pugh
 
Posts: n/a

Default Re: IE sucks (or maybe it's me): class selector fails - 04-24-2008 , 06:55 AM






On Apr 23, 2:12*pm, DuncanIdaho <Duncan.Idaho2... (AT) googlemail (DOT) com>
wrote:

Quote:
I have the following in my stylesheet

.navbody a{
* * * * text-decoration: none;
* * * * color: rgb(68, 146, 181);
}

a.leaf{
* * * * text-decoration: none;
* * * * color: rgb(254, 100, 253);
* * * * font-size: 0.75em;
}

AJAX produces the following html
[snip]

Quote:
in Opera and Firefox the anchor with class 'leaf' is rendered in a
smaller pink font (nice!) in IE it's rendered in the same sized light
blue as other stuff in the navbody

Are class selectors supposed to work when output is dynamically
generated ? or is this another 'feature' of IE
Known problem with IE when elements are added to the DOM via scripting
(the fact that the content was fetched via AJAX is irrelevant, you can
see the same issue when adding it locally). You need to apply the
class via the className property _after_ the element has been inserted
into the DOM. I used to know the reason for this but it's slipped my
mind (must be getting old). Ask in an IE or JavaScript related group
for more details.

Steve



Reply With Quote
  #3  
Old   
DuncanIdaho
 
Posts: n/a

Default Re: IE sucks (or maybe it's me): class selector fails - 04-27-2008 , 03:18 AM



Steve Pugh wrote:
Quote:
On Apr 23, 2:12 pm, DuncanIdaho <Duncan.Idaho2... (AT) googlemail (DOT) com
wrote:

I have the following in my stylesheet

.navbody a{
text-decoration: none;
color: rgb(68, 146, 181);
}

a.leaf{
text-decoration: none;
color: rgb(254, 100, 253);
font-size: 0.75em;
}

AJAX produces the following html
[snip]

in Opera and Firefox the anchor with class 'leaf' is rendered in a
smaller pink font (nice!) in IE it's rendered in the same sized light
blue as other stuff in the navbody

Are class selectors supposed to work when output is dynamically
generated ? or is this another 'feature' of IE

Known problem with IE when elements are added to the DOM via scripting
OK, well I tried a javascript group with no luck, I've got a few ideas
though so I'll give them a try.

Thanks for taking the time to reply

Idaho


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.