我们在#1审查这里的问题,一个语气关于垂直对齐和高度100分%的问题,如:垂直对齐和浮动DIV问题内线高度
https://stackoverflow.com/questions/6743208/css-why-vertical-align-middle-does-not-work
Fill height of a floating nested div
还有更类似的链接,但他们都没有帮助我们。
的jsfiddle代码:http://jsfiddle.net/cD6nd/1/
HTML代码:
<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 showed it -->
CSS代码:
#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;
}
下面是它如何看待这个MOME快照NT:
我们希望有一个-HREF文本是在容器的中间,我们想用height:100%
,而不是我们使用目前使用em
的。
你会意识到,如果你让你的身高100%,它会自动在中间这个技术是很有用该div,因为它形成了多大的单词的div ... – BuddhistBeast
http://jsfiddle.net/cD6nd/3/ – BuddhistBeast