我試圖把我在中央圖標或我的頁面(上面的菜單導航頭&中心)它從菜單移開,但不橫向移動離開或者無論如何,都只是保持在同一個位置。標誌不會向左或向右移動內部頭標記
我已經竭盡所能搜索谷歌也沒有。結果表明up.Tried使頭部相對的,試圖使相關菜單。 這是我的代碼。
body {
width: 800px;
margin: 100px auto 0 auto;
background: darkgrey;
font-family: arial;
display: block;
}
#header {
width: 800;
height: auto;
margin: 0;
background: transparent;
}
#h1.logo {
position: absolute;
right: 50px;
}
#tabs{
overflow: hidden;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
}
#content
{
background: #fff;
padding: 2em;
height: 520px;
position: relative;
z-index: 2;
border-radius: 0 5px 5px 5px;
box-shadow: 0 -2px 3px -2px rgba(0, 0, 0, .5);
}
#tab2 {
position: relative;
}
#icons img {
padding-right:5px;
0% { /* space between content and footer*/
position: absolute;
top: 20;
right: 50px;
}
}
footer {
display: inline-block;
width:800px;
text-align: left;
margin-top: 250px;
}
footer ul {list-style-type: none;
text-align: center;
float: left;
}
footer li {display:inline;
}
footer a:link{
text-decoration: none;
}
footer p {
float:right;
}
table {border: solid darkgrey thin;
position: relative;
left: -100px;
z-index: 2;
<body>
<header>
<h1 class="logo">
<img src="images/Logodraft.png" alt="Kieron's Logo" title="Kieron's Logo" />
</h1>
</header>
<!--navigation starts here-->
<!--An unordered list that holds the tab navigation items-->
<ul id="tabs">
<li><a href="index.html" title="tab1">Home</a></li>
<li><a href="about.html" title="tab2">About</a></li>
<li><a href="portfolio.html" title="tab3">Portfolio</a></li>
<li><a href="blog.html" title="tab4">Blog</a></li>
</ul>
<!--A wrapper for each tab content-->
<div id="content">
</div>
<!--end content div-->
<footer> <!--footer starts here-->
<div id="tab3">
<table border="0" width=1024px height=0px>
<tr>
<td><a href="index.html"><img src="images/logoicon.png"/></a></td>
<td><a href="index.html">Home | </a> <a href="about.html">About | </a> <a href="portfolio.html">Portfolio | </a> <a href="blog.html">Blog</a></td>
<td align="right"><small>©copyright 2016 Kieron Roberts</small></td>
</tr>
</table>
</div>
</footer> <!--end of footer-->
</body>
1問題,但,當我開始採取寬出體外標記它的拉伸頁面上的所有內容我都希望內容的div和內容以及菜單位於內容的左側和右側,而不是跨越整個頁面的寬度。我認爲這很混亂,因爲我有4頁,而另外3頁我沒有更新,所以CSS看起來很亂,因爲它引用了2個不同的html頁面。 –