View Full Version : Hover Link Problems


Obsidian
01-07-2006, 10:40 PM
Hey, I'm trying to make a link that will have a transparent background when you don't hover over it, and a colored background when you do. But the colored background has to span the entire width of the page; when you just do:

a: hover {background-color: blah}

it only colors the area where the text is. I guess the effect I want is kind of similar to something in the program Winamp--when you select a file to play, the colored background spans the entire width of the playlist, regardless of size. BUT the text shouldn't be abnormally spaced out to span the entire width of the page too, like T H I S or whatever.

So... how do I do that?

Heh, sorry this post is so long. I've always just been a "wordy" person. *sheepish* (And thanks in advance to anyone who responds! Actually, just thanks to anyone who had the patience to read through all that! :D)

djou
01-07-2006, 11:26 PM
I strongly doubt it is possible to make the background color span the width of the page. Links are inline elements, which means that every bit of CSS you apply to them is limited to the size the link takes.

Obsidian
01-08-2006, 12:16 AM
Oh... thanks anyway! :)

Spid
01-08-2006, 01:37 AM
Could this be done with javascript? Just a thought.

djou
01-08-2006, 03:09 AM
Could this be done with javascript? Just a thought.

I'm quite sure it couldn't. Like I said, a is an inline element and will be treated as so by every language out there.