• Resolved bricksmith

    (@bricksmith)


    I’m having problems with styling of images.

    The css for my theme specifies that images should be styled float: right.

    However, I thought that I would be able to override that simply by specifying a different position (ex: left) when inserting an image into a post using the image editor. So far, it’s not working. Any ideas?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Can you provide us a link?

    Keep in mind that when you specify position using the media gallery while placing an image, it just adds a CSS class to the image. You’ll need to edit your CSS to tell the browser how to position imagery with these classes.

    Make sense?

    Thread Starter bricksmith

    (@bricksmith)

    I think I get what you are saying, sewmyheadon. I’ll check further into that. Here’s a link to the blog:

    https://28nineteen.com/

    Right now, you have a generic definition for all images in your posts:

    div.post img, div.page img { float: right; padding: 5px; }

    This is causing all images to float right. If you’d like to be able to use the position selector through the Media Gallery, it will add classes to your image and you can add the following CSS in your style.css file to override these positions:

    div.post img.alignleft {float:left;}
    div.post img.alignright {float:right;}

    Thanks, sewmyheadon – this helped me in one of my sites.

    Thread Starter bricksmith

    (@bricksmith)

    Thanks so much!

    I left the generic definition in place so my existing posts would not be messed up and added the .alignleft and .alignright. That seemed to do the trick.

    Thanks!

    Thanks! It worked for me as well after I slightly modified the code to match the theme css, which is using “contentleft” instead of “post.”
    #contentleft p img.alignleft {float:left;}
    #contentleft p img.alignright {float:right;}

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘image styling problem’ is closed to new replies.