【发布时间】:2015-01-01 04:09:20
【问题描述】:
我在保持导航的右边缘与标题的外边缘对齐时遇到问题。有没有什么简单的方法可以解决这个问题,所以无论浏览器大小如何,它们都会排列整齐。 我的 HTML 在下面。
<!DOCTYPE html>
<html>
<head>
<title>Webpage Layout</title>
<style>
* {padding: 0px;}
html {
width: 970px;
margin: auto;
}
header, footer {
width: 100%;
text-align: center;
height: 10%;
margin: 5px;
border: 1px solid black;
}
section, nav, aside {
text-align: center;
padding: 0px;
height: 80%;
float: right;
margin: 5px;
border: 1px solid black;
}
section {width: 480px;}
nav, aside {width: 218px;}
</style>
</head>
<body>
<header>
<h1>Header</h1>
</header>
<aside>
<h1>Aside</h1>
</aside>
<section>
<h1>Section</h1>
</section>
<nav>
<h1>Nav</h1>
</nav>
</body>
</html>
任何帮助将不胜感激
【问题讨论】: