开发者

Div Float with Image [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

When I float a div with text it in the be开发者_如何学Gohavior is what I want but when I put an image inside, the float dosen't behave the same way and the image then goes down one line. Why is that?


Put the image before the text if you want the text on the right side of the img. to make sure the text flows to the right of the img float:left.

<div  style="float:left;">
<img src="someimg" style="float:left;"/>
<p>Text will pop on right</p>
</div>

if you first want text then image

<div  style="float:left; width:200px;">
<p style="width:80% float:left;">Text will pop on left</p>
<img src="someimg" style="width:20%"/>
</div>


Dug these up from my favorites as they've helped me in the past. Galchen is right - we need some markup / CSS to better understand your issue.

The Image might go down if it's being set to a block element in a style - which would do this.

http://css.maxdesign.com.au/floatutorial/

http://www.tizag.com/cssT/float.php

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜