WordPress.org

Ready to get started?Download WordPress

Forums

Expanding Post to Fit Image (4 posts)

  1. costumecity
    Member
    Posted 4 years ago #

    I just started using a new theme, RedBel, and it looks great. However, when I add images that are longer than the post text, they flow out of the post box.

    http://halloweencostumeadvice.com/2010/adult-costumes

    That is the best example that I have. When the text is longer than the image, the post box automatically expands to accommodate it. Does anyone know how to edit the css to make is so that the post will expand to fit images?

    Thanks,
    Wes

  2. New Nine Media
    Member
    Posted 4 years ago #

    Your image is being floated to the right and it is not cleared. (If that doesn't make sense, don't worry -- read on for the fix.)

    You content is held in a div with a class of article-page-contents

    <div class="article-page-contents">

    When you post your image and align it to the right, you need to "clear" it before closing the article-page-contents div.

    Just before the closing div for the article-page-contents, but after all of your text and images, put this:

    <div style="clear: both;"></div>

    That will put your site back into the "flow" and extend that container past your picture.

  3. costumecity
    Member
    Posted 4 years ago #

    Awesome, thank you so much. I have another question that maybe I can answer myself if I just sit down and read a bit about css, but i'll try here.

    Where is that div class being assigned? I don't see it showing up in the html for my post, so i'm assuming that it is in the style sheet? I will try to located it myself in the meantime, although I don't know if there is anything I can do about it other than adding your suggestion to the posts that need it.

    Thanks again.

  4. New Nine Media
    Member
    Posted 4 years ago #

    It will be in one of two places:

    1. in one of your theme files (like single.php), or
    2. in the plugin or function that generates the output for the page

    I can't tell exactly as I can't see your theme and what plugins you're using.

Topic Closed

This topic has been closed to new replies.

About this Topic