nested class and :hover not working

lvh's Avatar

lvh

14 Nov, 2010 06:17 PM

Hi :)

I'm just experimenting with LESS and so far I've been very impressed, but I ran into a problem with a nested rule with :hover and .myClass:hover. Attached is the file, both with what I would have expected to work and the plain-old-CSS hack that makes it actually work.

I'm using LESS.js, should I be using the ruby script to see what CSS it produces?

thanks in advance
lvh

  1. 2 Posted by lvh on 14 Nov, 2010 10:37 PM

    lvh's Avatar

    FWIW I tested it with the :visited pseudoclass and that doesn't work either which leads me to believe I'm just doing something wrong.

  2. 3 Posted by Chris on 16 Nov, 2010 09:25 PM

    Chris's Avatar

    I've ran across this as well, my solution was to use the "&" symbol to force a:hover

  3. 4 Posted by kenmaclord on 06 Dec, 2010 05:46 PM

    kenmaclord's Avatar

    thanks for this tips, it work perfectly with the & symbol. The reason was that the nesting rule put a white space between nav and :hover. In CSS 'nav :hover' fails, but 'nav:hover' works.

    Ken.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

21 Jun, 2013 06:43 AM
28 Dec, 2012 12:32 PM
29 Oct, 2012 03:35 PM
16 Oct, 2012 07:04 PM
27 Aug, 2012 10:45 PM
21 Aug, 2012 12:37 AM