* {
margin: 0px;
}
.container {
background: #ccc;
line-height: 50px;
verticle-algn: middle;
clear: both;
}
.float {
overflow: hidden;
float: right;
}
<div class="container">
<button class="inside">inside</button>
<button class="float">float</button>
</div>
Please check this example.I want the .float
element to be vertically centered of the .container
element as the .inside
element.But no matter I trigger BFC
or add a pseudo element
, I can not clear the impact of the float
element.I don't think margin is a best way to solve this.Can you tell me how to fix it, thanks for your help.