http://jsfiddle.net/usnmLuy5/3/
使用顯示:塊直列保持塊使用100%的寬度。使用購物車上的浮動物,並設置標題的高度,以便購物車適合。拼寫檢查高度,CSS中有一個高度被忽略,不需要。
#header-parent {
padding-top:5px;
padding-bottom:5px;
border-bottom: 1px solid White;
background: #45484d; /* Old browsers */
background: -moz-linear-gradient(top, #45484d 43%, #000000 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(43%,#45484d), color-stop(100%,#000000)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #45484d 43%,#000000 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #45484d 43%,#000000 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #45484d 43%,#000000 100%); /* IE10+ */
background: linear-gradient(to bottom, #45484d 43%,#000000 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#45484d', endColorstr='#000000',GradientType=0); /* IE6-9 */
}
#header {
position: relative;
margin-left: auto;
margin-right: auto;
cursor: pointer;
height: 36px; /* same as cart */
}
#header-child{
padding:5px 0 5px 0;
display:inline-block;
}
#header-title {
display:inline-block;
}
#header-title img{
width: 25px;
heigth: 25px;
margin-right:5px;
vertical-align: middle;
}
#header-cart{
display: inline-block;
text-align:center;
background-color:red;
float:right;
color:white;
font-size: 15px;
}
#header-cart img{
width: 30px;
heigth: 30px;
}
#header-cart #cart-icon{
float:left;
}
#header-cart #cart-title{
float:left;
}
#header-cart #header-title{
display: inline-block;
background-color:blue;
}
#header-title span{
color: white;
font-family: Georgia, Times, "Times New Roman", serif;
font-size:20px;
margin-top: 0;
margin-bottom: 0;
vertical-align: middle;
}
不要忘記清除你的花車:) – 2014-10-01 22:57:56