Results 1 to 3 of 3

Thread: css link/hover issue

  1. #1
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default css link/hover issue

    Hi,

    I'm progressing with learning css and loving it.
    I am building a basic horizontal nav bar and assigning different bg colours for the link and hover states within a 25x10 pixel thin bordered box. I have then inserted the text and their corresponding a href links.
    The issue I have is that I want the whole of the box not just the text itself to be an active link.
    Typically download.com has exactly what I am trying to achieve in css in their left nav column (albeit vertical).

    Hope this makes sense and that someone can help. cheers

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by neilkw
    I am building a basic horizontal nav bar and assigning different bg colours for the link and hover states within a 25x10 pixel thin bordered box.
    If the links are text- rather than image-based, don't specify the size using pixels. Use em lengths, instead (they will adjust better to different font sizes).

    The issue I have is that I want the whole of the box not just the text itself to be an active link.
    Normally, one can change the box layout to block using the display property:

    Code:
    .menu a {
      display: block;
    }
    However, if an ancestor of the links (usually the list item) uses the inline display property value, then this isn't a wise idea; placing block-level elements inside in-line elements is undefined. The usual solution here is to use floats.

    Why don't you Google for one of the numerous CSS layout repositories? There will be plenty of examples for you to choose from.

    Mike

  3. #3
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    cheers mike. many thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •