After scouring through numerous discussions on Stackoverflow regarding vertical alignment and 100% height issues, we have not found a solution. Some of the topics we explored include:
Vertical-align middle not working in CSS
How to fill height of a floating nested div
CSS div 100% height issue
Despite these and similar resources, none have provided us with a solution.
Access our JSfiddle code here: JSfiddle Code
HTML code:
<div id="header">
<div id="logo_container">
<a href="main-catalog"><img src="img/logo-finder.png" alt="Logo Example"></a>
</div><!--Logo container-->
<a href="main-catalog" id="aplication_lookup_button" class="button_link">Search by application</a>
<a href="search-product-catalog" id="search_product_button" class="button_link">Search by part number</a>
</div><!-- Main header where logo and buttons are displayed -->
CSS code:
#header
{
width:100%;
background: #000;
float:left;
}
#logo_container
{
width: 14.0056%;
text-align: center;
float: left;
}
#logo_container img
{
max-width: 50%;
height: auto;
}
.button_link{
text-align: center;
color: white;
text-decoration:none;
text-transform: uppercase;
width: 25%;
height: 4.1em;
float: left;
}
#aplication_lookup_button
{
background: #424242;
border-bottom: 4px solid #2eaeb8
}
#search_product_button:hover
{
color: #2eaeb8;
font-weight: bold;
}
Shown below is a snapshot of the current layout:
We aim to vertically align the text within the anchor tags and prefer to use height:100%
instead of the current usage of em
.