473,472 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

'hover' for non-anchor link..

I have some links..
http://www.francesdelrio.com/linksCSS.html

want it so when you hover over link ENTIRE DIV gets gray bg color (not
just text (like link Three is now on this page..)

but when hover over it, can only do so link (text) gets bg color, not
entire div.. which of course is no good b/c it only highlights text, not
block..

<div id="NavLeft"><a href="" class="nav" title="">Link One</a></div>
<div id="NavLeft"><a href="" class="nav" title="">Link Two</a></div>
(all css code in page in link above..)
etc..
I tried:

#NavLeft:hover {background-color:#EEEEEE}

but it didn't work.. I've seen this :hover used like this before, for a
non-anchor tag element.. in some of those css-drop-down menu demos..
(li:hover ul { display: block; }, for example, from here..
http://www.alistapart.com/articles/horizdropdowns

would appreciate some suggestions.. thanks..
Jun 18 '06 #1
8 2826
On Sun, 18 Jun 2006 14:50:12 -0400, maya <ma********@yahoo.com> wrote:

: want it so when you hover over link ENTIRE DIV gets gray bg color
That is a job for javascript. Not CSS, not HTML.

Sid
Jun 18 '06 #2
maya wrote:
I have some links..
http://www.francesdelrio.com/linksCSS.html

want it so when you hover over link ENTIRE DIV gets gray bg color (not
just text (like link Three is now on this page..)

but when hover over it, can only do so link (text) gets bg color, not
entire div.. which of course is no good b/c it only highlights text, not
block..

<div id="NavLeft"><a href="" class="nav" title="">Link One</a></div>
<div id="NavLeft"><a href="" class="nav" title="">Link Two</a></div>
(all css code in page in link above..)
etc..
I tried:

#NavLeft:hover {background-color:#EEEEEE}

but it didn't work..
In Firefox it does. IE doesn't implement this.

Try

a { display: block; }.

I've seen this :hover used like this before, for a non-anchor tag element.. in some of those css-drop-down menu demos..
(li:hover ul { display: block; }, for example, from here..
http://www.alistapart.com/articles/horizdropdowns

would appreciate some suggestions.. thanks..

Jun 18 '06 #3
Sid Ismail wrote:
On Sun, 18 Jun 2006 14:50:12 -0400, maya <ma********@yahoo.com> wrote:

: want it so when you hover over link ENTIRE DIV gets gray bg color
That is a job for javascript. Not CSS, not HTML.

Sid

ok, thanks, it's as I feared then, need to do w/JS b/c CSS2 only
implemented by FF (and IE 7, but that's not good enough since most folks
still on IE 6..)

ALTHOUGH: little sample code I sent from that other pg does work in
IE6...(??)

thank you very much..
Jun 18 '06 #4
maya wrote:
I have some links..
http://www.francesdelrio.com/linksCSS.html
want it so when you hover over link ENTIRE DIV gets gray bg color (not
just text (like link Three is now on this page..)

I tried:

#NavLeft:hover {background-color:#EEEEEE}

but it didn't work.. I've seen this :hover used like this before, for a
non-anchor tag element.. in some of those css-drop-down menu demos..
(li:hover ul { display: block; }, for example, from here..
http://www.alistapart.com/articles/horizdropdowns

IE only supports :hover on anchor (<a>) elements. You'll have to use
alternate methods to get :hover to work on other elements.
Notice in the example you gave, that IE is explicitly mentioned is to
primitive to work as expected. A bit of Javascript is provided. Of course,
if the visitor has JS disabled, they are SOL.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jun 18 '06 #5
In article <59********************************@4ax.com>,
Sid Ismail <el***@nospam.com> wrote:
On Sun, 18 Jun 2006 14:50:12 -0400, maya <ma********@yahoo.com> wrote:

: want it so when you hover over link ENTIRE DIV gets gray bg color

That is a job for javascript. Not CSS, not HTML.


No, that's a job for CSS. It's in the spec, it's a styling feature,
therefore it's CSS. Javascript should be used for dynamic content
modification. Changing the background style of a block doesn't
qualify as content modification.

The problem the OP is facing is that Microsoft's abysmal and
nonstandard implementation of CSS forces us to use javascript hacks
to get around IE's shortcomings. This will be fixed in IE7, but
in the meantime, my attitude is, if IE users can't see decorative
features, that's tough. Microsoft is not paying me to work around
the bugs in their browser.

-A
Jun 18 '06 #6
Jim Moe wrote:
maya wrote:
I have some links..
http://www.francesdelrio.com/linksCSS.html
want it so when you hover over link ENTIRE DIV gets gray bg color (not
just text (like link Three is now on this page..)

> I tried:

#NavLeft:hover {background-color:#EEEEEE}

but it didn't work.. I've seen this :hover used like this before, for a
non-anchor tag element.. in some of those css-drop-down menu demos..
(li:hover ul { display: block; }, for example, from here..
http://www.alistapart.com/articles/horizdropdowns


IE only supports :hover on anchor (<a>) elements. You'll have to use
alternate methods to get :hover to work on other elements.
Notice in the example you gave, that IE is explicitly mentioned is to
primitive to work as expected. A bit of Javascript is provided. Of course,
if the visitor has JS disabled, they are SOL.


ok, thanks.. I'm just trying to make it work like this one..
http://www.ecommercepartners.net/clients.shtml (links on the left.. they
get gray bg color when user hovers over them..)

couldn't glean from code how they do it on this pg.. (no JS functions
are called.. and it works in IE6...)

many thanks....:)


Jun 18 '06 #7
maya wrote:
#NavLeft:hover {background-color:#EEEEEE}

but it didn't work.. I've seen this :hover used like this before, for a
non-anchor tag element.. in some of those css-drop-down menu demos..
(li:hover ul { display: block; }, for example, from here..
http://www.alistapart.com/articles/horizdropdowns


IE only supports :hover on anchor (<a>) elements. You'll have to use
alternate methods to get :hover to work on other elements.
Notice in the example you gave, that IE is explicitly mentioned is to
primitive to work as expected. A bit of Javascript is provided. Of course,
if the visitor has JS disabled, they are SOL.


ok, thanks.. I'm just trying to make it work like this one..
http://www.ecommercepartners.net/clients.shtml (links on the left.. they
get gray bg color when user hovers over them..)

couldn't glean from code how they do it on this pg.. (no JS functions
are called.. and it works in IE6...)

The same way as the AListApart does it. Set the *anchor* (<a>) to
display:block, not the list element (<li>).

Get the Firefox or Seamonkey browser <mozilla.org> and add this
extension to it: <http://chrispederick.com/work/webdeveloper/>. One its
many useful features is the display of CSS for a selection.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jun 19 '06 #8
To further the education of mankind, maya <ma********@yahoo.com>
vouchsafed:
IE only supports :hover on anchor (<a>) elements. You'll have to
use
alternate methods to get :hover to work on other elements.
Notice in the example you gave, that IE is explicitly mentioned is
to
primitive to work as expected. A bit of Javascript is provided. Of
course, if the visitor has JS disabled, they are SOL.


ok, thanks.. I'm just trying to make it work like this one..
http://www.ecommercepartners.net/clients.shtml (links on the left..
they get gray bg color when user hovers over them..)

couldn't glean from code how they do it on this pg.. (no JS functions
are called.. and it works in IE6...)


That's a simple hover on link changing the background. View the
stylesheet.

--
Neredbojias
Infinity has its limits.
Jun 19 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Sander Tekelenburg | last post by:
Trying to make some images disappear on hover (works), and others appear on hover (works not). In tested browsers, this gives the expected result: IMG.disappear {visibility: visible}...
8
by: JLahm | last post by:
I have defined a class for my images called .image that specifies the default border color, width and style. I'd like to be able to have the pseudo elements link, visited and active have one color...
15
by: Robert Mark Bram | last post by:
Hi All! Problem I began with: Netscape/Opera supports hover for different elements, IE only supports hover for <a> and I want to use hover for <td class="menu"> I then found a fix using some...
7
by: Matt | last post by:
Is there a way to increase the amount of time a hyperlink title displays or show the desired text using javascript? <a title="This is the title text displayed on hover.">Displayed Text</a> ...
24
by: Fred Lock | last post by:
Hello, I have a page with a usual mouseover link highlight effect eg.: a:hover {color: #ff0000; text-decoration: none;} I also have some anchor links such as: <a...
5
by: Gerry Vandermaesen | last post by:
Hi, I'm trying out the following: CSS .className { width: 30px; height: 30px; border: 1px solid black; }
24
by: fehays | last post by:
Hello, I'm having a problem with the css hover effect in IE. I have an <a> tag with the following CSS: a.subNavItem { display:block; color:#464645; padding:2px 7px 4px 6px;...
0
by: david.hunter | last post by:
Hi Group - I'd like to try to replicate something like this in CSS : http://www.checkeredshirt.com/jo-menu/ Currently - everything is in a table, and using JavaScript rollovers that reference...
3
by: noize | last post by:
I have found other bugs related to using hover is CSS with IE, but I cannot find a fix for my issue. I have checked it in both IE 6 & 7 with the same results. I have built a drop-down menu using...
8
by: Meri | last post by:
Hello Everybody on the internet seems to think this is a problem with IE but for me it works fine with IE, but the submenus do not appear with Firefox andOpera. The html is a simple list with...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.