I understand the CSS and how to use this horizontal Menu. I cant get it to automatically expand to a specifi width or just the space dedicated to it. I have to se the li to width:auto as I have some name that are long and others that are short. Is there a way to do this I have tried for hours.
See here http://labs.adobe.com/technologies/spry/samples/menubar/AutoWidthHoriz ontalMenuBarSample.html
Special Note:
The article should have added !important to the following
ul.MenuBarHorizontal ul li {
display: block;
float: none !important;
width: auto;
white-space: nowrap;
border-bottom: solid 1px #EEE;
}
This is to ensure that the JS does not overwrite the value.
Gramps
Thank You for your response. Yes those fixes adjust the size of each menu tab proportionally to the information in them. But How do I adjust the whole of the nav to a specific width so that it streches and there is no space hanging . That space looks differenet in every browser and it does not look good visually.
The best way to increase/decrease the widths of the menu items is to play with the left and right padding in ul.MenuBarHorizontal a
The differences in browsers is very hard to work with. You could try to use a CSS-reset as in http://meyerweb.com/eric/tools/css/reset/ but even that is not browser-proof.
The biggest difference will be in IE in which case you could use conditional values (<!--[if lt IE 10]>) or use the HTML5 boilerplate http://html5boilerplate.com/
Gramps
When it is necessary to fit a horizontal CSS menu into a tight container and the number and length of menu items is such that you cannot provide a generous buffer, your options are confined to:
1. Set the width explicitly for each menu item, factoring in box-model properties so that the aggregate is precisely the width of your container
2. Use images for the root items
The problem with #1 is that there is no way to guarantee that all browsers (or users) are going to be rendering the font the same size your device is. The chances of the menu breaking to 2 lines are very strong. Working with the pre-release version of Spry does not make things any easier, either.
--
Al Sparber - PVII
The Finest Dreamweaver Menus | Galleries | Widgets
Since 1998
Hi Altruistic Gramps,
in www.wesleytree.com do you know if I could at least center the whole nav in a space I have tried this link below but it does not center???
http://labs.adobe.com/technologies/spry/samples/menubar/CenteringHoriz ontalMenuBarSample.html
Thanks
Because the width of the menubar is fixed to the width of the container, it is already centered.
The solution is
1. change the width of the menubar to be equal to the width required by all of the menu items, or
2. change the width of the menubar to auto and apply left and or right padding (e.g. ul.MenuBarHorizontal {padding: 0 35px; width:auto;})
Gramps
You might like to have a look here http://pleysier.com.au/sprymenubar_images/
The stylesheet is here http://pleysier.com.au/sprymenubar_images/styles.css
Gramps
North America
Europe, Middle East and Africa
Asia Pacific