Pseudo. CSS.
Moderator: General Moderators
Pseudo. CSS.
I remember reading once that pseudo css selectors in IE only work on anchor elements.
Is this true? If so then what version(s) of internet explorer and what pseudo selectors do this?
Is this true? If so then what version(s) of internet explorer and what pseudo selectors do this?
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
I wouldn't call it overkill. Pseudo-selectors are very useful. Too bad IE doesn't play along.
For a good overview see Roger's article on css 2.1 selectors
For a good overview see Roger's article on css 2.1 selectors
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Anything done in pseudo classes can be done either through regular CSS or JavaScript. Any "flashy" features that you want implemented through pseudo selectors should be done with JavaScript, as only JavaScript enabled users would need to see it anyway. This includes div hovers and focus changes.
As for things like the first letter (nice for articles where you float the first letter and make it really large), you can dynamically surround the first letter with a class that does so. I believe that there was an ability to indent as well (:first-line or something), but it's generally not needed. Paragraph elements are well-separated.
Just don't try to depend on them because they are not dependable. A nice alternative is to try this:
As for things like the first letter (nice for articles where you float the first letter and make it really large), you can dynamically surround the first letter with a class that does so. I believe that there was an ability to indent as well (:first-line or something), but it's generally not needed. Paragraph elements are well-separated.
Just don't try to depend on them because they are not dependable. A nice alternative is to try this:
Code: Select all
div#selector:hover,
div#selector.hover {
color: #FFF;
}Code: Select all
var selector = document.getElementById('selector');
selector.onmouseover = function(){ this.className = 'hover'; }
selector.onmouseout = function(){ this.className = ''; }Sorry superdezign, I totally disagree with you. Pseudo classes can be useful for styling certain elements without having to mess up your HTML by inserting useless spans, classes and divs. The fact that IE6 doesn't support them is Microsoft's fault. You can use pseudo selectors in almost all modern and future browsers.
Just don't use them for something which is essential to all your visitors. But I think we can agree that styling the first letter of a paragraph isn't that essential, isn't it? Someone using IE6 (by choice or not) doesn't miss a thing, while people using FF or another browser get the full thing. Progressive enhancement, is what it's called.
Just don't use them for something which is essential to all your visitors. But I think we can agree that styling the first letter of a paragraph isn't that essential, isn't it? Someone using IE6 (by choice or not) doesn't miss a thing, while people using FF or another browser get the full thing. Progressive enhancement, is what it's called.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Apple's new design uses pseudo selectors for their navbar. http://apple.com
VbblӘ,s
VbblӘ,s
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Their browser support's it. :-pJellyFish wrote:Apple's new design uses pseudo selectors for their navbar. http://apple.com
VbblӘ,s
You don't see Microsoft using them. ^_^ (Well, maybe by now.)
Apple.com looks fine in IE, from what I can see.superdezign wrote:Their browser support's it. :-pJellyFish wrote:Apple's new design uses pseudo selectors for their navbar. http://apple.com
VbblӘ,s
You don't see Microsoft using them. ^_^ (Well, maybe by now.)
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm