将文字对齐到图片和&&文本不会环绕图像 [英] Align text to the right of an image && text doesn't wrap around the image

查看:80
本文介绍了将文字对齐到图片和&&文本不会环绕图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应该如下所示:

[img] text text
      text text

这是如何实现的?

看起来很直,奋斗。

推荐答案

您可以使用 display:inline-block;

img{
    display:inline-block;
    width:75px;
    height:100px;
    border:1px solid red;
    vertical-align:top;
    margin-right:10px;
}

div{
    display:inline-block;
    width:200px;
}

示例:http://jsfiddle.net/jasongennaro/SK9ad/

使 inline-block; 使用IE7,添加以下到每个规则:

To make inline-block; work with IE7, add the following to each rule:

zoom: 1;
*display:inline;

这篇关于将文字对齐到图片和&&文本不会环绕图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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