我的HTML非常简单
<div class="btns">
<div id="green"> <span 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
.btns {
position: relative;
}
#green, #red {
display: inline-block;
width: 49%;
position: relative;
}
.green_btn, .red_btn {
margin-bottom: 4px;
}
正如您在此处所见http://jsfiddle.net/HajHV/9/
Chrome上的看起来像这样
但在firefox上
我不明白这种差异。 html / css中没有任何内容对此有用。我该如何解决?
答案 0 :(得分:2)
将display: inline-block;
添加到.green_btn, .red_btn {...}
答案 1 :(得分:1)
添加vertical-align:top
#green, #red {
display: inline-block;
width: 49%;
position: relative; vertical-align:top
}
<强> DEMO 强>
答案 2 :(得分:0)
或者,试试:
.btns {
position: relative;
}
#green, #red {
display: inline-block;
width: 49%;
position: relative;
}
.green_btn, .red_btn {
margin-bottom: 4px;
}
#green {
float:left;
}
#red {
margin-left: 4px;
}