Box not floating next to each other

Joined
Dec 23, 2021
Messages
5
Reaction score
0
Hi, I have a div where I put two boxes in it, and I want to float the boxes left and right NEXT to each other exactly. However, the right box does float right but it is going at the bottom. See image. I want the right box to be where the red square is, that is next to the left box and NOT at the bottom.

2021-12-23 11_39_38-Window.jpg


Here are my CSS codes for the div and boxes:

Code:
div.contents {
    width:1000px;
    margin:auto;
}
div.left {
    width:490px;
    float:left;
    background:#ffffff;
    box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
    clear:both;
}
div.right {
    width:490px;
    float:right;
    background:#ffffff;
    box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
    clear:both;
}

Why it is not next to each other?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top