I have those 2 divs nested into the yellow div, and as you can see the green one is getting under the red one. I would like the green one to sit to the right of the red one. How can I do that? Thanks a lot
The screen shot is at:
https://i.stack.imgur.com/7cbCI.png
here is my code:
.reddiv {
height: 100px;
width: 150px;
background: red;
float:left;
margin:5px;
}
.greendiv {
height: 70px;
width: 300px;
background: green;
}
Add float:left to both red and green div and you should be set.
Be warned though that if you need to have another content below yellow div, your content might seem to ignore the height of your yellow div. To tackle that issue, easiest way is to add a third div with clear:both inside the yellow div