CSS question

Out of context: Reply #3

  • Started
  • Last post
  • 6 Responses
  • sparker0

    if it is a menu item or navigational link, you might want to consider using lists to create the menu, instead of tables.

    but that is optional, correct, but optional.

    anyway...

    monNom is right. you want to set the anchor rule to 'display:block'

    include padding on the a element, not the cell.

    and hover works in all browsers, just not backgrounds.

    there is no need for a hack or javascript intervention here. it can be done properly with xhtml and css alone.

    [code]

    a {
    display: block;
    background-color: #'xxx';
    padding: 'y'px
    ... rest of your css rules ...
    }

    a:hover {
    display: block;
    background-color: #'xxx';
    padding: 'y'px
    ... rest of your css rules ...
    }

    css and tables don't always mix...tables are not for layout/design purposes.

    please consider using lists for navigational items and menus.

View thread