一、首先,写好网页基本元素:
<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>首页</title></head><body> </body></html>二、写入CSS样式
<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>首页</title> <link rel="stylesheet" href="css/common.min.css""> <!--link 指调用外部文件,rel 指样式表, href 调用 文件地址、名-->
<link rel="stylesheet" href="css/okayNav.min.css"> <!--标签如上解释,文件名不同是指两条不同的CSS样式表-->
</head><body></body></html>三、在 body 里,写入<header>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" href="css/common.min.css"> <!---->
<link rel="stylesheet" href="css/okayNav.min.css">
</head>
<body>
<header id="header">
<a class="site-logo" href="#">logo</a>
<nav role="navigation" id="nav-main" class="okayNav">
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
</ul>
</nav>
</header>
</script>
</body>
</html>