fl00r
fl00r

Reputation: 83680

Inline div with static width

How can I put div inline and set constant width to it?

My example, which doesn't work proper: http://jsfiddle.net/fl00r/AtJFT/

Upvotes: 3

Views: 6206

Answers (3)

canon
canon

Reputation: 41675

Working example: http://jsfiddle.net/AtJFT/6/

2 changes:

  1. Use display: inline-block
  2. Your second div was blocking the first div from displaying on the same line.

Upvotes: 8

Teneff
Teneff

Reputation: 32158

if you need fixed width you will have you keep it block element, this is the idea ... all the inline elements expands depending on the content

Upvotes: 0

Matt Ball
Matt Ball

Reputation: 359906

You need to use display: inline-block.

Upvotes: 1

Related Questions