保持文字环绕浮动图像 [英] Keep text from wrapping around floated image

查看:120
本文介绍了保持文字环绕浮动图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一张左侧浮动的图片,以及一个位于右侧的文字块。该文本块不是当前浮动的,它只是在HTML中的图像之后。因为它变得更长,它最终踢到图像下面的左边继续。

I currently have an image that is floating left, and a block of text that rests to the right of it. That block of text is not current floated, it just comes after the image in the HTML. So as it gets longer it eventually kicks over to the left under the image to continue on.

如何使它的文字块总是停留在右边图像,所以图像和文本表现得像两个并排列?记住,我不能在这两个元素之外做任何事情。我不能在他们周围添加包装。我可以在之前,之间或之后添加元素。

How can I make it so the block of text always stays to the right of the image, so the image and the text behave like two side-by-side columns? Bear in mind that I cannot do anything outside of these two elements. I cannot add a wrapper around them. I can add elements before, between, or after. But not around.

感谢。

推荐答案

回答

只是浮动文本。 :)

http://jsfiddle.net/Hs7pN/

#image
{
    background-color: #09C;
    float: left;
    height: 200px;
    width: 200px;
}

#text
{
    float: left;
    width: 400px;
}

这篇关于保持文字环绕浮动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆