<!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>
/* 清除浏览默认设置 */
* {
margin: 0%;
padding: 0%;
/* 清除项目符号 */
list-style: none;
}
body{
background: rgb(65, 148, 65);
}
.NAV-left{
width: 190px;
height: 450px;
background-color:white;
padding: 10px 0%;
margin: 25px auto;
}
.NAV-left .AM-id{
height: 25px;
line-height: 25px;
padding-left: 18px;
font-size: 12px;
}
.AM-id:hover{
background-color: #d9d9d9;;
}
.AM-id a{
color: #333;
text-decoration: none;
}
.FZ{
padding:0%;
font-size: 10px;
}
</style>
</head>
<body>
<nav class='NAV-left'>
<div class='AM-id'>
<a href="#">松鼠</a><span class="FZ">/</span>
<a href="#">老虎</a><span class="FZ">/</span>
<a href="#">松鼠</a><span class="FZ">/</span>
<a href="#">老虎</a>
</div>
<div class='AM-id'>
<a href="#">松鼠</a><span class="FZ">/</span>
<a href="#">老虎</a><span class="FZ">/</span>
<a href="#">松鼠</a><span class="FZ">/</span>
<a href="#">老虎</a>
</div>
</nav>
</body>
</html>
a标签写的时候会把你的换行解析为空格,你写的时候a标签不要和span标签放一行,这样默认左右就是一样的间隔。
小白一枚,望大佬看到答疑
https://www.w3school.com.cn/cssref/css_selectors.asp
您好,我是问答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632