html - Inline-Block with 2 or more elements besides -


i try work out, 2 p should besides image , second p not under image. possible float: left causes lot of browser bugs (mainly under ie). how wished result display: inline-block?

<div id="one">     <img src="http://www.jcopro.net/wp-content/uploads/2011/12/ubuntu-logo1.gif" alt="" />     <p>content</p>     <p>content</p> </div> 

#one {     display: inline-block;     width: 800px;     vertical-align: top; }  #one img {     display: inline-block;     vertical-align: top;     width: 100px; }  #one p {     display: inline-block;     vertical-align: top;     width: 600px;     border: 1px solid gray; } 

demo: http://jsfiddle.net/mk5e9/1/

edit: okay mis-described problem: don't want have p in 1 row besides each other, want have them under each , both paragraphs besides image.

yes, need container wide enough contain 3 elements. following works when shrinking <p>s 300px wide.

example

edit, based 1 op's edit:

well, that's float meant for. floating images , allowing correct flow of text around them. example.

if wish image on different "column", meaning text won't flow around image, start new line @ line of image, need limit width of elements. see here.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -