Inside of a form I have a legend with a button:
<legend>Welcome Fictitious Employees
<div class="pull-right">
<button type="button" class="btn btn-primary" id="btnSave">Save</button>
</div>
</legend>
The button aligns with the bottom border of the legend in IE and Firefox reasonably, while in Chrome the button renders over the line:
What can I do to align the bottom of the button with the line?
Using bootstrap so - this should be the same across all browser. Basically its because you were floating the button with the pull-right class.
<legend>
<div class="row">
<div class="col-xs-8 text-left">
<p>Welcome Fictitious Employees</p>
</div>
<div class="col-xs-4 text-right">
<button type="button" class="btn btn-primary " id="btnSave">Save</button>
</div>
</div
</legend>
To somewhat achieve a vertical alignment of the button and the paragraph use these css rules
p {
margin: 0;
line-height: 35px;
}
the drawback is that the line-height is fixed so if you change the button padding or dimensions in general you will have again inconsistencies so have that in mind.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments