我在百度上看了很多模板,但是跟我想做的不一样,其他部分都设计好了,就这里没有一点头绪。我不知道该如何把这两块内容结合到一起。
这样吗???
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
article {
position: relative;
padding-left: 120px;
border: 1px solid #ccc;
height: 600px;
}
nav {
position: absolute;
left: 0;
top: 0;
width: 119px;
border-right: 1px solid #ccc;
height: 100%;
}
nav a {
display: block;
}
section {
box-sizing: border-box;
height: 400px;
border-bottom: 1px solid #ccc;
}
h2 {
text-align: center;
padding: 0;
margin: 0;
}
aside {
height: 100%;
overflow: auto;
}
</style>
</head>
<body>
<article>
<nav>
<a href="#fib">Fibonacci数列</a>
<a href="#eu">Euler常数</a>
<a href="#wall">wallis公式</a>
</nav>
<aside>
<section id="fib">
<h2>Fibonacci数列</h2>
</section>
<section id="eu">
<h2>Euler常数</h2>
</section>
<section id="wall">
<h2>wallis公式</h2>
</section>
</aside>
</article>
</body>
</html>
css