7 Responses to “Aligning Images With Your Stylesheet.”

Comments

Read below or add a comment...

  1. Holy crap.. I always thot my WP theme was Fxrked up becos I can’t align my images like Blogger. Thank God you have spoken. It’s these little things in life that annoy the crap out of me. lol

    OK OK this is a real life saver. All my pictures in my WP blog are huge. YOu know why? Becos if I don’t make them huge, I’ll have the broken text on my left. Grr Grrr

    Thanks.

  2. Thanks, good artical. You can add these alignment features to just about any theme you want customized. If you are a Dreamweaver user, you can ‘see’ this happen in realtime while tweeking your theme Design View using a Dw extension called ThemeDreamer. There is an artical that addresses just in their How To secion.

    http://www.themedreamer.com/howto/image-align-and-text-wrap

  3. Thanks for the article and copy-pastable code. I’d figured out that my inserted images were calling the non-existent “alignright” from my css, but was struggling to insert my own code…yours worked like a charm!

  4. Hello All –
    I thought I’d see if anyone can work out the kink in my image-align issue:

    I have tried about EVERY solution I could find on all the forum sites concerning this, but nothing’s worked yet. Here is a prime example of my problem:

    http://www.epochsy.com/2009/01/27/edletwinter08/

    The David Bowie quote is meant to be centered, but obviously, is not. Here is what my style.css currently looks like:

    /*img.alignright { float:right; margin: 0 0 1px 5px; padding: 2px;}

    img.alignleft { float:left; margin: 0 5px 5px 0; padding: 2px;}

    img.aligncenter { float:center; margin: 0 5px 5px 0; padding: 2px;}*/

    /*This works to RIGHT align images, but not centered ones!!!*/

    img.alignleft, div.alignleft {
    float:left;
    margin:2px 2px 2px 0px;
    }
    img.alignright, div.alignright {
    float:right;
    margin:2px 0px 2px 2px;
    }
    img.centered, .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    }

    /*img.centered, .aligncenter, div.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    }

    img.alignright {
    padding: 4px;
    margin: 0 0 2px 7px;
    display: inline;
    }

    img.alignleft {
    padding: 4px;
    margin: 0 7px 2px 0;
    display: inline;
    }

    .alignright {
    float: right;
    }

    .alignleft {
    float: left;
    }*/

    If you can help me I would be infinitely grateful. I’ve been trying to fix this for about 3-4 hours, and if I can’t fix it by tomorrow night, my head might explode.

    Thanks!

  5. Nihar

    Hey, Thanks a lot. Was having the toughest time trying to figure this out.

  6. I’ve been wrestling with this problem all day with a new theme I installed and was on the verge of kicking my laptop. I’m not a techie, so thank you for explaining the fix so clearly!

Trackbacks

  1. [...] You may want to subscribe to my RSS feed. Thanks for visiting!More than a year ago, I posted the stylesheet codes for aligning images in your WordPress posts. Times have changed and WordPress has added many new advanced features. One [...]