[英]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.