简体   繁体   中英

Align Image left side and Text right side with css

I have image and a text,i need the image on the left and the text on the right.. i cant change the HTML, so i need to do it with CSS only.

<li>
  <article>
    <header>
      <h3>
        <a href="#">title</a>
      </h3>
    </header>
    <p>
      <img src="image.jpg">
    </p>
   </article>
</li>

In CSS you can use the float function and the margin function to help you with the image placement. just write your usual CSS code with float: left and float: right to help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM