Align text to the right of an image && text doesn't wrap around the image

前端 未结 2 1899
独厮守ぢ
独厮守ぢ 2021-02-14 02:46

Should look like this:

[img] text text
      text text

How is this accomplished?

Seems straight forward, but I\'m struggling.

2条回答
  •  走了就别回头了
    2021-02-14 03:06

    You can use 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;
    }
    

    Example: http://jsfiddle.net/jasongennaro/SK9ad/

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

    zoom: 1;
    *display:inline;
    

提交回复
热议问题