• Hi all:

    What information do I add to my style sheet to always force the following with every photo inserted into a blogpost?

    margin-top: 2px; margin-bottom: 4px; margin-left: 10px; margin-right: 10px;

    I want those margins to hold true for every image I could ever insert into a blog. I don’t want to have to enter them manually in every post. Can I default them via the style sheet?

    Thanks — detobey

Viewing 2 replies - 1 through 2 (of 2 total)
  • img{ margin:2px 10px 4px 10px;}

    img > for every image on your site
    { margin:2px 10px 4px 10px;} > top right bottom left

    note that you might want to find specific class that wrap or is applied to the image you want to work with then do
    .yourClass img { margin:2px 10px 4px 10px;}
    or
    img.yourClass { margin:2px 10px 4px 10px;}

    b/c if you use only
    img{ margin:2px 10px 4px 10px;}
    it will really margin out all image in your site.

    The easiest way (but this is for ALL images – also the header if applicable) would be

    img {
      margin: 2px 10px 4px 10px;
    }

    or in short hand

    img {
      margin: 2px 10px 4px;
    }

    Peter

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding margins automatically with CSS’ is closed to new replies.