Skip navigation
Glipt
Currently Being Moderated

Horizontal menubar fixed width.

Jun 6, 2012 8:54 PM

Hello I have a webpage with a width of 960 px.

 

I have a menu of 7 items with the contents set to auto so each element is a different width according to the text within.

 

It is in a <div> container of the same width.

 

Is there any way to make the menubar fill out to the full width pf the page.

 

I have tried altering the width tags in both the ul.MenBarHorizontal and ul.MenuBarHorizontal li tage to no avial.

 

Leaving it a bit off center is not too bad but causes rendering problems in Firefox and of course IE.

 

Any help is greatly appreciated.

 

Mac OSX 10.6.8, DW 6.

 

Thanks.

 
Replies
  • Currently Being Moderated
    Jun 6, 2012 11:49 PM   in reply to Glipt

    ul.MenuBarHorizontal a change the padding.

     

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 7, 2012 3:44 PM   in reply to Glipt

    Inline styles are probably the way to go as in

    <li style="width: 250px;"><a class="MenuBarItemSubmenu" href="#">Item 1</a>

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 8, 2012 5:22 PM   in reply to Glipt

    Yes, it is possible to place the info in an external style sheet. Simply give the menu item (<li>) a unique CLASS (or ID) and apply the rules to that class as in

    <li class="home"><a href="#">Home</a></li>

    The style sheet:

    ul.MenuBarHorizontal li.home {

        width: 7.36em;

    }

    Gramps

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 6:33 PM   in reply to Glipt

    Is ul.MenuBarHorizontal li.home an invalid class name that might cause problems when the site goes up?

    The class name is home (used in the markup as class="home"), the selector is ul.MenuBarHorizontal li.home (used in the style sheet). The selector can take different levels of specificity such as  li.home or just .home

     

    Should it just be .home?

    See above

     

     

    Should I avoid capitals and spaces for class names?

     

    Basically, a name must begin with an underscore (_), a dash (-), or a letter(a–Z), followed by any number of dashes, underscores, letters, or numbers and the name must be at least 2 characters long; no spaces.

     

    Gramps,

    lost the first match against DK

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points