开发者

Inline div with static width

开发者 https://www.devze.com 2023-02-19 13:46 出处:网络
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/

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

精彩评论

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

关注公众号