
The following will explain horizontally aligning images and floating images around text. įloating images allows images to horizontally align with each other and allows text to wrap around the image. The line of code below is for aligning an image to the left. The following explains how to align your images left, right, and center using CSS. Text DOES NOT wrap around images that are simply aligned. Images can be aligned left, right, and center using the div tag and an inline CSS style. The following sections will explain how to float and align images using CSS. This is good for displaying images like a gallery. Images can also be floated so they appear horizontally on your site. You will see the white space when you go though the aligning section.Ī floated image will allow the text to wrap around the image like a regular book or newspaper would do. Aligning leaves quite a bit of white space on your site. Aligning images will only position the image left, right, or center with the text following before and after the image. How you want to display the images will determine whether you will align or float the image.Īligned images do not wrap text around them. They can be aligned and floated to allow the images to be placed in particular locations on the page. Text-align Property Examples The text-align properties are set to right, justify, and center.Images can easily align and float images with CSS.

If the direction property is set to rtl, then the text will be aligned to the right side.

If the direction property is set to ltr, then the text will be aligned to the left side. If inherit is used with the root element, then the initial value for this property will be used.ĭepends on the value of the direction property.


For example, the width of a line of text can be adjusted by varying the word spacing.
