How do I put my menu links on a horizontal line with CSS?
What I'm trying to do is put my menu on a horizontal line rather than on a vertical 开发者_运维技巧line. Anyone knows how to do this?
http://nemofirm.com/cssheaderandfooter.php
I´d say reasonably valid html is a good starting point. You do realize that you have 2 html
tags and 2 body
tags, right?
And the missing ul
is already mentioned by others.
You must be driving the browser nuts as well ;-)
first of all you must have your li elemnts in ul
<ul>
<li></li>
<li></li>
</ul>
you can either float to the left; float:left;
or give them display:inline;
http://jsfiddle.net/kZzXs/ or http://jsfiddle.net/kZzXs/2/
As others have said: float: left
or display:inline
both do the trick. I also added the missing <ul>
tags. Hope that helps.
li
tags should have display: inline
style.
If we're talking about CSS, yeah, it sucks. But there's nothing better for now (I hope that some day, Web will be all about XML resources, XSLT translations and some kind of CSS++, which will describe how element should be seen rather than how it should be processed by browser).
精彩评论