Skip to main content

Exclude an Image from the Border Styles (HTML)

You may find that you want most of your images to have borders, but there are some exceptions and these need to have no borders. Rather then set up every image border independently, you can apply borders to all images and then set your "exception" images to use different styling.

  1. Set the border styles that you want to apply to those images that are to have borders. For this, follow the instructions in Borders on All Images (HTML).

  2. Open a topic that contains one of the images that are to have no borders.

  3. Select the mediaobject element for the image.

  4. Add the role attribute In theElement Attributes Panel and set its value to noborder.

  5. Select Save. Save icon.

  6. Use a code or text editor to create a CSS file. Give it a suitable name and save it with the .css extension.

    If you already use a custom CSS for your layout, you should edit that CSS file instead.

  7. To disable borders on those images with the role you created in step 4, add this code to your CSS:

    .mediaobject.noborder img {
        border: none;
    }
    
  8. Save your CSS file and Upload Customized CSS.

When you publish with that layout, the CSS styles will be applied to your published output.