How to Align Text Next to a Picture Using CSS?

Images are necessary to make your website appear creative and enticing. It is evidently one reason why visitors stay longer on your page. Adding colors to your site makes it lively. Aside from adding images, placement should be strictly identified. You should align your images to the text perfectly to make it look organized and appealing to the consumers.

Aligning the images means positioning the photo on the left, center or right of the texts. There are important codes to remember to successfully align your images in your website. You can directly copy and paste them to your CSS. Below are the codes you should keep in mind.

To align left:

<div style=”text-align: left”><img src=”/support/image/your-image.png” width=”100″ /></div>

To center align:

<div style=”text-align: center”><img src=”/support/image/your-image.png” width=”100″ /></div>

To right align:

<div style=”text-align: right”><img src=”/support/image/your-image.png” width=”100″ /></div>

For CSS novice, you can play on these codes and learn how it changes your website. Using these codes makes your page flexible and artistic. Readers will not get bored of single image placement style. Instead, they will see a variety of posts in every corner of your web page. You can check programming questions and answers and find any programming solutions you need with our help.

Start placing images on your site now and use these codes to make it engaging!