pseudo-class

:first-child fails when an element of a different class is dynamically inserted above

So, I've encountered a situation where inserting an element of a different class/id breaks all css-rules on that :first-child. <div id="nav"> <div class="nSub">abcdef</div> <div class="nSub">abcdef</div> <div class="nSub">abcdef</div> <div class="nSub">abcdef</div> <div class="nSub">abcdef</div> </div> .nSub:first-...

Unknown pseudo-element or pseudo-class :hover

I've never really paid this close attention but I'm getting the following error: Unknown pseudo-element or pseudo-class :hover on the following code A:hover { COLOR: #F56655; text-decoration: underline; } Since when has :hover not been valid css and what is the alternative? I have seen this used everywhere... ...

Recreating CSS pseudo-classes in jQuery

I am trying to add a little animation with jQuery to my navigation bar. Right now I have the sub menus of the nav bar changing from display:none to display:block with the css :hover pseudo-class. As I said, I am trying to do this with jQuery, so I need to create a selector that was similar to the one I used in my css. The selector I was ...

when is the :visited pseudo-class applied to a hyperlink

I have some questions about the :visited pseudo-class: Based on what do browsers decide when the :visited pseudo-class should be applied to a hyperlink? Do they take this information from the browser's page history or is it stored per-session or somewhere else? Is it possible (for the developer of a web page) to control for how long th...

:last-child psuedo class selector in CSS and Internet Explorer

Hi All, I have the following code: ul.myList li{ border-right: 1px dotted #000; } However, on the last element, I need to remove that border as the design that I am working from dictates that the last item does not require a border as a separator. So, I need to target the last child of a list and so within my css I have added ...

css pseudoclass:hover not working

I am struggling to get a simplest css hover pseudoclass to work. Anybody knows why the following doesnt work? the css #hidden {display:none;} #show:hover #hidden{display:block;} the html <a href="#" id="show">show</a> <div id="hidden">here i am</div> I really feel stupid asking such a simple question, i did this a hunderd times, b...

:active pseudo-class doesn't work in mobile safari

In Webkit on iPhone/iPad/iPod, specifying styling for an :active pseudo-class for an <a> tag doesn't trigger when you tap on the element. How can I get this to trigger? Example code: <style> a:active { background-color: red; } </style> <!-- snip --> <a href="#">Click me</a> ...

How to select all a pseudo-classes in CSS?

Hi, I've a button and I wanted to know if it is possible to make the css bellow shorter. .button a:link, .button a:visited, .button a:hover, .button a:active { color: #000; text-decoration: none; } I mean maybe: .button a:* { color: #000; text-decoration: none; } Maybe there isn't any shorter way, but I just wanted...