homepage Welcome to WebmasterWorld Guest from 54.205.241.107
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Can't style object
andrewsmd

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4223003 posted 9:43 pm on Oct 27, 2010 (gmt 0)

Why won't this work.



I have HTML like this
<td class="storeTitle"><span>Service Membership</span></td>

So in the css file I have this
.storeTitle SPAN
{
font-size: 18px;
color: #0B94C8;
}
That works fine in chrome but not in IE. Any ideas why?

 

CSS_Kidd

5+ Year Member



 
Msg#: 4223003 posted 2:23 pm on Oct 28, 2010 (gmt 0)

You need to give a "class" name to the span:

<td class="storeTitle"><span class="foo">Service Membership</span></td>

.storeTitle .foo (or simply .foo if you want)
{
font-size: 18px;
color: #0B94C8;
}


You can't style "span" as is.

birdbrain

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4223003 posted 3:25 pm on Oct 28, 2010 (gmt 0)

Hi there andrewsmd,

Your code worked OK, for me, in both IE6 and IE8. ;)

birdbrain

CSS_Kidd

5+ Year Member



 
Msg#: 4223003 posted 3:48 pm on Oct 28, 2010 (gmt 0)

Well maybe I shouldn't say "You can't"...

I will say, You shouldn't. :)

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4223003 posted 4:26 pm on Oct 28, 2010 (gmt 0)

While it's n0ot efficient to do .classname span, it's perfectly legitimate. It also leaves you open to specificity problems. Given birdbrain's test, the best bet is you have some other css on span that's overriding it. Check it out with Firebug.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved