WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cant place 2 divs next to each other (3 posts)

  1. Odenberg
    Member
    Posted 2 years ago #

    I really dont get this. I want to place two divs next to each other, in a div. But when I put an image in the first div, the second div is pushed down . I´ve tried everything I can think of, but nothing works. Without an image in the first div, the second div (with the posts) fits into the surrounding div.

    THE CODE:

    [code moderated - please use the pastebin]
    THE CSS:

    [CSS code moderated - please post a link to your site]

    Any one that can figure out what is happening and how to fix it?
    Id be very grateful. Ive been up all night and my husband is getting really annoyed...

  2. salsaturation
    Member
    Posted 2 years ago #

    Hi Odenberg

    If I am understanding you correctly all you need to do is add a floiat to the respective divs

    #row4-holder1{
    width: 190px;
    clear: none;
    float: left;
    }
    
    #row4-holder2{
    width:770px;
    float: right;
    }

    Make sure the images are not larger than the containing divs which I assume are 190px and 770px... in this case if you include the image border (border-left: solid 1px) the divs will become 191px and 771px respectively hence they cant fit into the 760px width.

    Anyway try that.

  3. Odenberg
    Member
    Posted 2 years ago #

    THANK YOU!

    I tried float:left on both divs before and it didnt work. Totally forgot to try to set the secon div to float:right.

    Thank one again!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.