Image styles

8 posts by 2 authors in: Forums > CMS Builder
Last Post: 17 hours ago   (RSS)

Are adding a class to the image to get it float left/right? 

The style will be set inline by telling the image to align left or right in the content area so adding a class to the upload window would work but better still for it to work automatically if the style is set. I don't think my client will always remember to select the class from the upload window though.

When you align left/right the image, does it add an attribute to the img tag in the HTML? 

for example...

<img align="left" src="image.jpg">

No, if you align the image in the wysiwyg editor it adds style="float:left"

In that case, add this to your css...

img[style*="float:left"] {
  margin-right: 1em;
}

img[style*="float:right"] {
  margin-left: 1em;
}

Brilliant, thank you. I've been searching and trying to do that css all day.

This is called ”attribute selectors” in case you want to look into it more