0

i have div element that has a class box and some content inside it.

  <div class="box">
    <h1>stack overflow</h1>
    <p>Lorem ipsum dolor sit a.  facilis  error! At, magnums quos ipsum, pianissimos .</p>
    </div>

as soon as i float left the content of the div, the content go out of the border. i need a clear explanation of why this happens. thank you!

.box{
  width: 800px;
  margin: 150px auto;
  border: 3px solid;
}
.box h1,p{
  margin: 5px;
  float: left;
}
Temani Afif
  • 211,628
  • 17
  • 234
  • 311

0 Answers0