I have two font icons in the (Bootstrap) navbar, a menu icon and a search icon:
<div class="menu-icon">
<i class="fa fa-bars"></i>
</div>
<div class="navbar-brand">
Website
</div>
<div class="search-icon">
<i class="fa fa-search"></i>
</div>
CSS:
.menu-icon {
float: left;
}
.search-icon {
float: right;
}
.menu-icon, .search-icon {
font-size: 1.6em;
padding: .6em 1em;
cursor: pointer;
background: #f55;
}
This works well on one browser but not on others because they have their own different sizes of font, which can also be changed in their settings.
This difference of size across different browsers require different padding or font-size
. Which is clearly visible if you set a background color for them.
How can I avoid this font difference?