還是很新的HTML和這樣所以道歉,如果這是一個很簡單的問題...HTML UI元素不正確中心
我有格式化的問題,我已經試過爲中心的導航元素我的文件,但他們似乎並沒有這麼做。
這裏是在瀏覽器中的問題的圖像 - http://i.imgur.com/A6630.png
這裏是我的HTML。 (有一些蛋糕Ipsum在那裏開機)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>About Me Example Page:</title>
<link href="../css/aboutcss.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="wrapper">
<h1><img src="../images/about/aboutlogo.png" alt="About Me" style="height:100px;"></h1>
<nav>
<ul>
<hr align="center"/>
<li><a href="../index.html">Home</a></li>
<li><a href="../portfolio/index.html">Portfolio</a></li>
<li><a href="../contact/index.html">Contact</a></li>
<li><a href="../blog/index.html">Blog</a></li>
<hr />
</ul>
</nav>
<img src="../images/about/aboutmephoto.jpg" id="me">
<p>Hello there!</p>
<p>Liquorice powder liquorice dragée macaroon. Dessert oat cake pastry cheesecake wypas brownie icing. Marzipan sweet dragée icing candy wafer tart macaroon pie. Halvah liquorice pie carrot cake pie. </p>
<p>Liquorice powder liquorice dragée macaroon. Dessert oat cake pastry cheesecake wypas brownie icing. Marzipan sweet dragée icing candy wafer tart macaroon pie. Halvah liquorice pie carrot cake pie. </p>
<hr align="center" width="50%" />
<p>Liquorice powder liquorice dragée macaroon. Dessert oat cake pastry cheesecake wypas brownie icing. Marzipan sweet dragée icing candy wafer tart macaroon pie. Halvah liquorice pie carrot cake pie. </p>
<p>Liquorice powder liquorice dragée macaroon. Dessert oat cake pastry cheesecake wypas brownie icing. Marzipan sweet dragée icing candy wafer tart macaroon pie. Halvah liquorice pie carrot cake pie. </p>
<footer>
© Me 2012
</footer>
</div>
</body>
</html>
而且對於同一頁面的CSS:
body {
background-color: #3D3D3D;
}
p, a, footer {
font-family: 'Open Sans', Sans Serif;
}
h1 * {
height: 125px;
display: block;
margin: 0 auto;
}
p {
color:#E2E2E2;
font-size: 13px;
margin-left: auto;
margin-right: auto;
padding-left: 10px;
padding-right: 10px;
}
footer {
font-size: 9px;
padding-bottom: 8px;
text-align: center;
color:#E2E2E2;
}
nav {
text-align:center;
}
nav li {
display: inline;
}
nav a {
display: inline-block;
text-decoration: none;
color: #E2E2E2;
font-size: 17px;
font-variant: small-caps;
font-weight: bold;
padding:0;
margin-left: 3em;
margin-right: 3em;
}
a:visited {
color:#E2E2E2;
}
#wrapper {
max-width: 1200px;
width: 90%;
background-color: #1A1A1A;
margin-left: auto;
margin-right: auto;
border-style: solid;
border-width: 2px;
border-color: black;
}
#me {
margin: 25px;
border-style: solid;
border-width: 5px;
border-color: #656565;
height:300px;
float:right;
}
在此先感謝您的幫助!
避免的,你可以把 「邊界」,以 「UL」。 – alditis