I'm taking this course called HTML, CSS, and Javascript for Web Developers. I'm in the lecture that talks about floating elements, my problem is that when I add the properties "float" and "margin-right" to the element p selector, the background of the div disappears. Can somebody help me, please?
div {
background-color: blue;
}
p {
width: 50px;
height: 50px;
border: 1px solid black;
float: left;
margin-right: 10px;
}
#p1 {
background-color: #A52A2A;
}
#p2 {
background-color: #DEB887;
}
#p3 {
background-color: #5F9EA0;
}
#p4 {
background-color: #FF7F50;
}
section {
clear: left;
}
<div>
<p id="p1"></p>
<p id="p2"></p>
<p id="p3"></p>
<p id="p4"></p>
</div>
<section>This is regular content continuing after the paragraph boxes</section>