The following html&css works fine in chrome but on firefox it is not aligned
<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;
}
here is the jsfiddle
I don't understand why they are not aligned in firefox but in chrome they are fine.
used to this
Define your #green, #red
id vertical-align:top;
#green, #red {
display: inline-block;
vertical-align: top;}
you just add float:left;
above #red #green
see the jsFiddle .
#green, #red {
display: inline-block;
width: 49%;
position: relative;
float:left;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.