Dynamic horizontal navigation menu with unique images
I'm trying to create a main navigation menu running horizontally accross the top of my page that has a unique image with the relevant link below it. I have added the images as a generic property of the web pages but I'm stumped on how I can get this to go horizontal.
Do I have to resort to tables or has anyone been able to achieve this with CSS?
I've tried these options and it works fine when it's just text but when there's images what I get is a horizontal list of menu items beside a horizontal group of images. Even though I specified the images first. It's much trickier than it should be.
Marius I like your idea of images as the background, but how do I make this dynamic? Remember each image is associated with it's particular menu item.
Dynamic horizontal navigation menu with unique images
I'm trying to create a main navigation menu running horizontally accross the top of my page that has a unique image with the relevant link below it. I have added the images as a generic property of the web pages but I'm stumped on how I can get this to go horizontal.
Do I have to resort to tables or has anyone been able to achieve this with CSS?
If the menu is in li's try float:left
Also try : display:inline
for example
And use images for div inside li o as background for li.
Marius.
I've tried these options and it works fine when it's just text but when there's images what I get is a horizontal list of menu items beside a horizontal group of images. Even though I specified the images first. It's much trickier than it should be.
Marius I like your idea of images as the background, but how do I make this dynamic? Remember each image is associated with it's particular menu item.
There's probably something similar somewhere here -> http://www.cssplay.co.uk/menus/ ; everything is there!
Dan
Thanks Dan there's a great selection of menus there but unfortunately none that fit what i'm trying to achieve.
I've stripped out all my other styles as I found some were conflicting with the menu. Now I have a horizontal list with...
image text image text... (all bottom aligned)
what I want to achieve is...
image image image
text text text
my html goes like this...
<ul class="menulinks">
<li>
<img...>
<a href...>
</li>
...
</ul>
my styles are...
.menulinks{
padding: 3px;
margin: 0;
display: inline;
list-style-type:none;
text-align: center;
}
.menulinks li {
display: inline;
margin: 0;
}
.menulinks li a {
text-decoration: none;
padding: 3px 7px;
margin-right: 3px;
}
.menulinks li.selected a
{
position: relative;
top: 1px;
padding-top: 4px;
}
Ok Folks in case you ever want the answer to this...
Stylesheet
#menu-contain
{text-align:center;
height:135px;
background:url(../media/Assets/line.gif) repeat-x 0 43px;}
#menulinks
{padding:0;
margin:0 auto;
list-style:none;
width:763px;}
#menulinks li
{ float:left;
text-transform:uppercase;}
#menulinks li a
{ display:block;
width:108px;
margin-right:1px;
font:normal 14px/16px verdana, arial, sans-serif;
text-align:center;
text-decoration:none;
color:#024;}
#menulinks li a img
{ display:block;
border:0;
margin:0 auto;
padding-bottom:5px;}
#menulinks li a:hover
{ font-weight:bold;}
is working on a reply...