When i display below, the text 'Here is some text' is below the image - i want it to show to the right of the image?
<div st开发者_运维问答yle="width:50px;">
<img src="http://assets.devx.com/MS_Azure/azuremcau.jpg" alt="blah" width="70" height="70" />
</div>
<div style="width:150px;">
<h2>Here is some text</h2>
</div>
<div style="width:50px; display: inline-block;">
<img src="http://assets.devx.com/MS_Azure/azuremcau.jpg" alt="blah" width="70" height="70" />
</div>
<div style="width:150px; display: inline-block">
<h2>Here is some text</h2>
</div>
changed float:left to display:inline-block. This is a better solution because it doesn't remove items from the document flow. Make sure you specify a width for every one though.
<div style="float: left; margin-right: 10px;">
<img src="http://assets.devx.com/MS_Azure/azuremcau.jpg" alt="blah" width="70" height="70" />
</div>
<div style="width: 300px;">
<h2>Here is some text</h2>
</div>
<br style="clear: both;" />
This should work.
精彩评论