How do I put text that is inside a P element next to a image?

前端 未结 4 1085
感情败类
感情败类 2021-01-19 23:58

Here is my code:


This is some example text that i want next to th

4条回答
  •  自闭症患者
    2021-01-20 00:26

    As a side note, since you tagged this as HTML5, you would be better off using

    and
    to mark up this content.

    For example:

    Text
    This is some example text that i want next to the image on the right hand side

    Then you could style it like:

    figure {
       margin: 0;
       width: 600px;
       height: auto;
       overflow: hidden;
    }
    figure img {
       width: 30%;
       float: left;
    }
    figure figcaption {
       width: 70%;
       float: right;
    }
    

提交回复
热议问题