如何在没有包装图像的图像旁边浮动段落? [英] How to float paragraph next to image without wrapping the image?

查看:93
本文介绍了如何在没有包装图像的图像旁边浮动段落?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想浮动一个段落在图像旁边,但不包装图像。像这样:

I want to float a paragraph next to image, but without wrapping the image. Like this:

div.img {
        float: left;
        display: block;
        margin: 15px 2% 0 2%;
        width: 26%; /* I cannot use that */
}

div.info {
        float: right;
        display: block;
        margin: 15px 2% 0 2%;
        width: 66%; /* The width should be variable */
}

问题是我可以做如果我将 width 设置为img和info,但图片是可变宽度/高度。它没有特定的宽度/高度。

The problem is that I can do it if I set width to both img and info but the image is a variable width/height. It does not have specific width/height.

在这种情况下,我几乎迷失了。请给我建议任何东西。我想让两个div彼此相邻,没有包装..没有指定框宽度。

I am almost lost in this situation. Please suggest to me anything.I want both divs to float next to each other without wrapping .. without specifying box width.

任何解决方案...工作?

Any solution..workaround?

推荐答案

您可以使用一些js: http://jsfiddle.net/vXMkR/

You can do it with some js: http://jsfiddle.net/vXMkR/ .

这篇关于如何在没有包装图像的图像旁边浮动段落?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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