Forum Moderators: not2easy
I need to make a horizontal navigation menu. Names of menu items are of different length(from "FAQ" to "System Requirements"). I want the selected menu item to have a background image. It looks like: left corner, part that can be used with repeat-x, right corner.
Maybe this picture will help my poor explanation:
/--------------------\
¦System Requirements¦
\_________________/
/----\
¦FAQ¦
\___/
Tried yesterday all day long, but couldn't get something acceptable.
Your repeat-x background can be set on the <ul> itself or <div> container.
eg.
ul.nav {
background: #666 url(img/navbkgrd.gif) 0 0 repeat-x;
}ul.nav li {
float: left;
background: transparent url(img/leftcorner.gif) 0 0 no-repeat;
}ul.nav li a {
display:block;
width:100%;
background: transparent url(img/rightcorner.gif) right top no-repeat;
}
(...these styles aren't complete - to give the idea)
This will handle expanding of the menu items in the horizontal and you can create another class (perhaps for the <li>, or may be the <a>) for the selected state.
HOWEVER, if you want your menu to grow in all directions (eg. when the user increases the text size in their browser) then you will need to separate the top/bottom, left/right corners and include extra markup (DIVs / SPANs) within the <li> to hang these off.