I wanted to make a flexbox and realized that it does not work with !DOCTYPE html. When I removed !DOCTYPE html the flexbox shows. Does anyone know why?
<!DOCTYPE html>
<html>
<style>
#boxcontainer{
background: gray;
display: flex;
height: 100%;
}
#box1{
background-color: dodgerblue;
width: 25%;
height: 50%;
}
#box2{
background-color: orangered;
width: 25%;
height: 50%;
}
#box3{
background-color: violet;
width: 25%;
height: 50%;
}
#box4{
background-color: yellow;
width: 25%;
height: 50%;
}
#box5{
background-color: green;
width: 25%;
height: 50%;
}
</style>
<div id="boxcontainer">
<div id="box1"></div>
<div id="box2"></div>
<div id="box3"></div>
<div id="box4"></div>
<div id="box5"></div>
</div>
</html>