Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS menu: hover highlighting

Status
Not open for further replies.

dbrb2

Instructor
Jul 19, 2004
121
GB
Hi,

I suspect this is very basic. I'm a bit of a dinasour, only now moving from frames. I've been playing with a CSS menu system I've put together at:


I'm having difficulty with the position of the text and the area that is highlighted when the mouse is over the link. Ideally I'dd like the highlighted bar to cover the entire width of the blue pane, but this only seems to be possible if the text starts from the extreme left of the screen, with no indent... Can anyone help? My stylesheet is given on the page above.

Cheers,

Ben
 
You should use padding to ensure the text is flushed all the way to the left edge (so padding-left should be a considerable number) and at the same time make sure the a element extends across the whole blue area. Because it is the anchor element's background that changes, which produces the effect of highlighting. And as long as you know how box model works, you will have no problems.
 
Hi,

Putting in a large value for padding-left for the navbar:ul class only seems to push the text over to the right...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top