+ Reply to Thread
Results 1 to 4 of 4

Thread: add margins to images

  1. #1

    Default add margins to images

    I'm trying to add a margin to all my images. I'm pretty new to CSS, so I'm sure I'm making a dumb mistake, but here's my code:

    /*---:[ image styles ]:---*/
    .entry img { margin: 10px 10px 10px 10px; }
    .entry img, .entry .gallery img { border: 3px double #bbb; margin: 0.1em 0; }
    .entry img.left, .entry img.alignleft { padding: 3px; margin: 10px 10px 10px 10px; float: left; clear: left; }
    .entry img.right, .entry img.alignright { padding: 3px; margin: 10px 10px 10px 10px; float: right; clear: right; }

    It looks exactly the same as it did before I added the 10px margins.

    Thanks so much!
    Sam

  2. #2
    Join Date
    Feb 2009
    Posts
    605

    Default

    Can you give the URL of the site you're working on? And did you use the image classes in the HTML of your blog posts? Also, there could be some code in the stylesheets that could be overriding it, we'll need to check all these things.

    Edit: I checked your site, your HTML should contain class="alignleft" and the like. The code align=left won't be affected by the CSS. Also, I couldn't find your code below in the stylesheets on your site, only the old styles.



    Quote Originally Posted by Parenthetical View Post
    I'm trying to add a margin to all my images. I'm pretty new to CSS, so I'm sure I'm making a dumb mistake, but here's my code:

    /*---:[ image styles ]:---*/
    .entry img { margin: 10px 10px 10px 10px; }
    .entry img, .entry .gallery img { border: 3px double #bbb; margin: 0.1em 0; }
    .entry img.left, .entry img.alignleft { padding: 3px; margin: 10px 10px 10px 10px; float: left; clear: left; }
    .entry img.right, .entry img.alignright { padding: 3px; margin: 10px 10px 10px 10px; float: right; clear: right; }

    It looks exactly the same as it did before I added the 10px margins.

    Thanks so much!
    Sam

  3. #3

    Default

    When I use class="alignright" instead of align=right, the image doesn't align correctly anymore:

    <img src="/wp-content/uploads/Specials.JPG" alt="me as Specials cover" class="alignright"/>

    on page: http://www.parenthetical.net/about-me/

    And style.css definitely contains the code above (with the margins); not sure why it doesn't look that way to you?

    Honestly, my understanding of CSS is really, really limited. I should probably do a quick tutorial somewhere and then come back... I'm sure I'm just doing something dumb.

    Thanks so much!

    Sam

  4. #4
    Join Date
    Feb 2009
    Posts
    605

    Default

    I'm sorry but I really can't see the CSS code from my end. I can't find it in here: http://www.parenthetical.net/wp-cont...t-11/style.css

    Basically, I'm looking at the CSS applied to the image using WebKit Inspector and it's got nothing. Try using Firebug (http://getfirebug.com)



    Quote Originally Posted by Parenthetical View Post
    When I use class="alignright" instead of align=right, the image doesn't align correctly anymore:

    <img src="/wp-content/uploads/Specials.JPG" alt="me as Specials cover" class="alignright"/>

    on page: http://www.parenthetical.net/about-me/

    And style.css definitely contains the code above (with the margins); not sure why it doesn't look that way to you?

    Honestly, my understanding of CSS is really, really limited. I should probably do a quick tutorial somewhere and then come back... I'm sure I'm just doing something dumb.

    Thanks so much!

    Sam

+ Reply to Thread

Similar Threads

  1. Trouble with inserting images
    By mehubbard in forum Posts, Pages, Comments
    Replies: 1
    Last Post: 12-07-2009, 10:35 AM
  2. Borders around images in 1.4
    By HolmesPI in forum Posts, Pages, Comments
    Replies: 3
    Last Post: 09-02-2009, 10:53 AM
  3. Resizing Images
    By Shaw_Girl in forum Community Exchange
    Replies: 3
    Last Post: 07-20-2009, 05:51 PM
  4. Please help find images.
    By joelgeez in forum Header & Nav Bar
    Replies: 1
    Last Post: 06-15-2009, 02:19 PM
  5. Labeling Images
    By deb_n in forum SEO
    Replies: 8
    Last Post: 02-22-2008, 02:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts