我正在嘗試使用以下代碼使我的徽標中心成爲可能。css上的居中圖像
它位於標頭容器中。
<div class="header-container">
<div class="header">
<h2 class="logo">
<a href="www.www.com" title="scorpia" class="logo">
<img src="headerbg.jpg" alt="scorpia">
</a>
</h2>
</div>
</div>
.logo {}
.header-container {}
.header {
margin:0 auto;
padding:0px;
text-align:center;
position:relative;
z-index:10;
}
.header .logo {
display:block;
text-decoration:none !important;
}
.header .logo strong {
position:relative;
top:-999em;
left:-999em;
width:0;
height:0;
font-size:0;
line-height:0;
text-indent:-999em;
overflow:hidden;
}
.header h1.logo, .header h2.logo {
margin:0;
}
這是我得到..正如你可以看到它是一個小向右
任何人都知道我怎麼能解決這個結果呢?
哪一部分是'.header'中心?您還需要發佈標記。 – styfle
.header是白色空間..對不起..不知道我應該發佈什麼 – John
爲'.header'指定寬度,'width:1000px'會爲你做 –