开发者

Inline div with static width

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

My example, whic开发者_JAVA百科h doesn't work proper: http://jsfiddle.net/fl00r/AtJFT/


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.


You need to use display: inline-block.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜