I know that If i created a div around the two lists and set the width to the width of the widest navigation list, it would force the other one below it, but I dont want to over do the Div’s, and was hoping there’d be a solution without it…
If you set the ul to clear:right it will appear on a new line if that’s what you meant.
#headerinset ul {
float:right;
display:inline;
clear:right;
}
You can’t wrap an anchor around a div as it is invalid and the anchor would need ot be iside the block element. If you want the anchor the size of your h1 then set the size of the h1 and set the inner anchor to display:block width appropriate dimensions.
I notice that you are using double id’s to target some elements.
As #headerinset is unique there is no need to use a full path name unless you need it to have more weight. Keep it simple and it will be easier to manage, less weight and faster.
With classes you do often need full pathnames as you can change their meaning depending on context but id’s are unique to the document and there can only be one on the page. Although you could use a pathname if you wanted the same id on another page to behave differently but I don’t think that’s required here.
I would reduce it to something like this (of course I can’t see your image so I may have missed something)
I’m also thinking that the div around the h1 is unnecessary from the code shown above and the image could be applied direct to the h1 and the surrounding div removed completely.
Apologies for the poorly worded title of this post, I type way to fast for my brain…
Thanks very much, that’s a great help. I’ve made the changes and taken all of that on board. It all worked out as expected.
My only issue now is the two lists are actually placed outside of the header boundaries…
I’ve used firebug and it shows the distinct header div and when I inspect the nav lists, they are outside of the header div. Do you why this might be the case?
The mark up is exactly as stated on my previous post?
I can’t see the html for the #header element but I’m guessing that you haven’t cleared the floats or that the height on your header is too small to contain the elements
Do you have a working example or revised full code that I can look at?
Have you floated the h1 to the left as well? The floated menus on the right will start on a new line as they will not rise up above static content that comes before them (the h1) in the html. Floats must come first on the html if you want block content to rise alongside.
Note also that you can’t wrap an h1 in an anchor as it is invalid. The anchor needs to be inside the h1.
[COLOR=#009900][COLOR=#000066][B][/B][/COLOR][/COLOR][COLOR=#009900][COLOR=#000066][B]<h1>[/B][/COLOR][/COLOR] [COLOR=#009900][COLOR=#000066][B]<a[/B][/COLOR] [COLOR=#005500]href[/COLOR]=[COLOR=#CC0000]"front_page.php"[/COLOR] [COLOR=#005500]title[/COLOR]=[COLOR=#CC0000]"icom works ltd"[/COLOR][COLOR=#000066][B]>[/B][/COLOR][/COLOR]
icom Print Management[COLOR=#009900][COLOR=#000066][B]</a></h1>[/B][/COLOR][/COLOR][COLOR=#009900][COLOR=#000066][B][/B][/COLOR][/COLOR]
You can set the anchor to display:block and give it a width and height to match your image etc.
thanks alot, that’s very interesting. So if I have floated items in a div alongside block level items then I should always place the floated elements before the block level elements in my code?
Yes that’s right and it’s quite logical if you think about it.
If a float rose up alongside the html above it then it would just keep rising up and up until it disappeared out of the top of the monitor.
A float will float from the position that it occupies in the normal flow and will then float left or right as required. It will not rise upwards but will allow following elements to wrap as required assuming there is room.
A float will only rise upwards if it follows another float and there is room for them both to fit in the space above.