Within the main container, you will find three smaller containers as shown in the attached file. The first two containers are styled with "float: left", while the third container has the "clear: both" property applied to it.
However, it appears that when the "clear" property is added to the third container, the margin-top feature stops working.
I have a couple of questions that I hope you can help me with:
- Why is this occurrence happening?
- What steps can I take to resolve this issue?
Thank you for your assistance!
Code:
div#insideContainer1
{
max-width: 500px;
padding: 20px;
box-sizing: border-box;
border: 1px solid #e0e0e0;
border-radius: 5px;
float: left;
}
div#insideContainer2
{
max-width: 500px;
padding: 20px;
box-sizing: border-box;
border: 1px solid #e0e0e0;
border-radius: 5px;
margin-left: 20px;
float: left;
}
div#insideContainer3
{
max-width: 500px;
padding: 20px;
box-sizing: border-box;
border: 1px solid #e0e0e0;
border-radius: 5px;
margin-top: 30px;
clear: both;
}