Previous Message
Next Message

#idname.classname - IE Support

Sent by Krisbob on 1 December 2005 17:05


Kevin Cannon wrote:

>Hi,
>
>Is it possible ot use a rule with an ID and a class name in IE.  e.g. like so:
>
>	<div id="tabs" class="ski">...</div>
>
>	#tabs.ski {
>		background-color: green;
>	}
>
>That works fine in Firefox, but in IE the first rule works, but subsequent
>ones don't:
>
>http://www.multiblah.com/exps/css/id_class.html
>
>On that page, #tabs.home doesn't work, but if I change it to #tabs.ski it'll
>work fine in all browsers.
>
>I'm at a bit of a loss, and so are the oher CSS afficiando's in here.
>
>Any ideas?
>
>- Kevin
>
Try switching ur class and id around - so that tabs becomes the class 
and ski and home become the id's:

..tabs {
        padding: 2em 1em;
        border: 2px dotted black;       
}
   
..tabs#ski {
        background-color: green;
}
   
..tabs#home {
        background-color: blue;
}

ofcourse, rewrite the div as id="home" class="tabs" else no browser will 
see anything :)

That seemed to get it going in IE and FF for me, although maybe there's 
an approach that doesn't involve switching around id's and classes. Hope 
this helps..

Cheers,
Bob


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.8/183 - Release Date: 25/11/2005

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: