[英]Why is span and form div not aligned in firefox
以下html&css在chrome中运行良好,但在firefox上它没有对齐
<div class="btns">
<div id="green">
<span id="cls" class="btn btn-block btn-large btn-success disabled green_btn">Green</span>
</div>
<div id="red">
<form class="button_to" >
<div>
<input class="btn btn-block btn-large btn-danger red_btn" type="submit" value="Red">
</div>
</form>
</div>
</div>
CSS
#cls:hover {
background:black;
cursor:pointer;
}
.btns {
position: relative;
}
.num {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
}
#green, #red {
display: inline-block;
width: 49%;
position: relative;
}
.green_btn, .red_btn {
margin-bottom: 4px;
}
这是jsfiddle
我不明白为什么他们没有在firefox中对齐,但在chrome中它们很好。
你只需添加float:left;
上面#red #green
看到jsFiddle 。
#green, #red {
display: inline-block;
width: 49%;
position: relative;
float:left;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.