I have this code I wrote to recreate a basic site home page:
* {
box-sizing: content-box;
margin: 0;
}
body div:first-child {
background-color: rgba(0, 0, 0, 0.5);
height: 550px;
width: 850px;
margin: auto;
margin-top: 30px;
border-radius: 10px;
}
header {
text-align: center;
}
header :first-child {
height: 80px;
margin-top: 50px;
}
header>div {
background-color: rgb(0, 255, 0);
height: 30px;
width: 80%;
margin: auto;
display: inline-block;
}
<div>
<header>
<img src="" />
<h2>Taking booleaners from A to B</h2>
<div>
<button>Prenota</button>
<button>Termina Prenotazione</button>
<button>Accendi Luci</button>
</div>
</header>
</div>
The problem is that the buttons get shown below the div despite being its children and I can't understand why this is happening.