Good day! I did some reasearch and I read here difference between css height : 100% vs height : auto
that height-auto should take the minimum amount of space depending on the children's width.
In my case, the property behaves like width 100%
, taking 100% of it's parent's width
Here is the code:
<!DOCTYPE html>
<html>
<head>
<style>
.header2 {
float:left;
width:900px;
height:23px;
background:red;
}
.buttonHolder {
margin: 0 auto;
width:auto;
height:24px;
background:black;
}
.button {
width:50px;
height:24px;
background:blue;
float:left;
}
</style>
</head>
<body>
<div class="header2">
<div class="buttonHolder">
<div class="button"></div> <div class="button"></div> <div class="button"></div>
</div>
</div>
</body>
The question is: Where is my error?