Grow your CSS skills. Land your dream job.

CSS3 & HTML5 – figcaption under floated image with wrap text problem

  • MBM
    # December 16, 2011 at 12:05 pm

    I have floated an image and used the figcaption tag to add text under it but the text is not aligned correctly. How do I position the text under the image while wrapping the body text to the left of the image?

    This is the class to float the image :


    .imagel {
    margin-top: 20px;
    margin-left: 20px;
    float:right;
    font-size: 16pt;
    color: #FFFF00;
    }

    And the html to caption the image :



    Spartacus
    Andy Whitfield as Spartacus

    And the result

    # December 16, 2011 at 12:21 pm

    First, you don’t seem to have the opening

    tag. You’ll want to float the entire figure tag, like this: http://jsfiddle.net/HPCYm/

    # December 16, 2011 at 4:20 pm

    its simple.. dont set width or hight to img tag…

    MBM
    # December 16, 2011 at 6:01 pm

    Thanks Doc.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".