How to put links in a menu horizontally using CSS?

What I'm trying to do is place my menu on a horizontal line, not a vertical line. Does anyone know how to do this?

http://nemofirm.com/cssheaderandfooter.php

+4
source share
4 answers

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 this helps.

+1
source

I would say that reasonably correct html is a good starting point. You understand that you have html tags and two body tags, right?

And the missing ul already mentioned by others.

You must also manage browser nuts; -)

+4
source

you must first have your li elements in ul

 <ul> <li></li> <li></li> </ul> 

you can either swim to the left; float:left; or give them display:inline;

+3
source
Tags

li should have display: inline style.

If we're talking about CSS, yes, that sucks. But now there is nothing better (I hope that someday the Web will be devoted to XML resources, XSLT translations and some CSS ++, which will describe how the element should be viewed, and not how the browser handles it).

-2
source

Source: https://habr.com/ru/post/1347253/


All Articles