| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
vague™
Join Date: Mar 2004
Location: Glasgow
Posts: 5,488
|
IE Multiple Class Names
Code:
IE doesn't seem to like this and only plays ball when you resort to: Code:
Any/All known workarounds/fixes would be welcomed Last edited by i_am_cam : 04-02-2005 at 11:32. |
|
|
|
|
|
#2 (permalink) | |
|
Senior Member
Join Date: Jan 2005
Posts: 12,358
|
Quote:
Does that even validate? Don't think I've ever seen that before... Did you try... Code:
Or are you applying an ID and a CLASS to an HTML element? Not sure if that's "kosher" (not to mention necessary)...I'd have to look it up. It's exactly this sort of situation that makes me try to avoid classes (as in CSS classes |
|
|
|
|
#3 (permalink) | |
|
vague™
Join Date: Mar 2004
Location: Glasgow
Posts: 5,488
|
Quote:
Yes i'm applying an id and a class to an element, and it's both necessary & a valid technique i'm just wondering if anyone's managed to get this working in IE |
|
|
|
|
#6 (permalink) |
|
hmmm...
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
|
I see what you're doing. Seems to only take the first definition. A quick and easy workaround is to use a double class instead of an id so: .test.test2 { background:#0F0; color:#fff; } .test.test1 { background:#000; color:#fff; } with <div class="test1 test">test</div> <div class="test2 test">test</div> works just as you want. Not sure that helps though, does it need to be an ID?. |
|
|
|
#7 (permalink) |
|
vague™
Join Date: Mar 2004
Location: Glasgow
Posts: 5,488
|
Code:
That's an example of what I was wanting to achieve, where there could be N amount of subclasses of #header and #footer. SB; both formats are valid (with/without a space) and fwiw neither work in IE, the Fox works with the way i've got it above. stickmus, cheers for the suggestion but double-classes doesn't allow me to reuse the same class name at different stages of my document and for different purposes which was my intention. |
|
|
|
#8 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,235
|
what you're doing does seem to work in IE for me, at least I think I understand what you're trying to do. However... Aren't you really just overwriting #header with #header.home? In that case would it be easier, rather than writing class="home" in the header, footer or where ever divs, to just give the body an individual class? That way you could have .home #header { ... } or .otherpage #header { ... }. it's officially friday night now though. |
|
|
|
#11 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,358
|
This made me slap my forehead. Your CSS... Code:
And then I realized I'm using the same thing on my site!!! HTML Code:
The lack of a space between #someid and .someclass confused me to no end. I guess I thought you were trying to apply a class to the ID and not the element. Putting a space between the two should be fine. Silly me. |
|
|
|
#12 (permalink) |
|
Anarchist by Accident...
Join Date: Feb 2003
Location: Oxfordshire UK
Posts: 137
|
IE does have a parsing issue with this when using javascript to pass style values at any point say for colour switching! Other than that, I've never had an issue with #id.class Isn't this where specifity/cascade comes in? #id .class {} element#id {} element.class {} element#id.class {} html>element#id.class {} html>element#id.class [type=attribute] {} Though today I discovered: *{...} |
|
![]() |