使用 CSS 构建垂直导航栏
cssweb developmentfront end technology更新于 2025/6/5 11:24:17
要构建垂直导航栏,您可以尝试运行以下代码。
示例
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 5;
padding: 5;
}
li a {
display: block;
width: 70px;
background-color: orange;
}
</style>
</head>
<body>
<ul>
<li><a href = "#home">Home</a></li>
<li><a href = "#company">Company</a></li>
<li><a href = "#product">Product</a></li>
<li><a href = "#services">Services</a></li>
<li><a href = "#contact">Contact</a></li>
</ul>
</body>
</html>
相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

