user1866818
user1866818

Reputation:

How to make a horizontal list with divs?

I am trying to make a simple list , in which there will be 3 divs. I can not do that, although I did exactly what in this topic was mentioned :

Horizontal (inline) list in HTML/CSS with divs

The divs appear vertical and I can not imagine why.

Do you know any other way to do it?

Thank you in advance.

Upvotes: 1

Views: 10833

Answers (2)

ThaDick
ThaDick

Reputation: 190

  1. using display: inline; is not the same as using inline-block.
  2. It looks like you're trying to to display list-items, not divs inline.

If #2 is correct, you need to make sure that you use display: inline-block, not display: inline.

Also, from your code, you'll want to make sure your ul element has an id="navlist" ... The same style will not work for all other UL elements in the document.

Upvotes: 2

anders
anders

Reputation: 202

If you use display: inline or float: left they will probably appear horizontal.

Upvotes: 3

Related Questions