How to place Text and an Image next to each other in HTML?

后端 未结 3 1229
情深已故
情深已故 2020-12-30 20:18

I want the text and the image to be next to each other but I want the image to be on the far left of the screen and I want the text to be on the far right of the screen. Thi

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 20:51

    img {
        float:left;
    }
    h3 {
        float:right;
    }
    

    jsFiddle example

    Note that you will probably want to use the style clear:both on whatever elements comes after the code you provided so that it doesn't slide up directly beneath the floated elements.

提交回复
热议问题