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:
- Use
display: inline-block
- 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
精彩评论