Reply to Re: css selectors

Your name:

Reply:


Posted by Toby A Inkster on 04/18/07 08:03

Jon Slaughter wrote:

> ul li a:hover
> {
>
> }
>
> Then the style references everything in a. is there any way to tell it to
> reference li instead?

No, but you have two options:

ul li:hover
{
/* Styles go here.
* However, there is no way of knowing whether the <a> element
* is also being hovered. The cursor might be over the <li> but
* not over the <a>. If you want the <a> to fill he entire area
* of the <li>, then set it to display:block;height:100%;
*/
}

Or attach a small Javascript function to the onmouseover/onmouseout events
for the <a> element which toggles the class of its parent element.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация