解决span中间的空隙的多种方法
作者:
_孙小胖 | 来源:发表于
2018-11-02 15:28 被阅读0次<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>span中间有间隙</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
/*第一种*/
.nav_left{
width:100%;
font-size:0;
}
span{
padding:10px 20px;
font-size:16px;
background:#ddd;
border:1px solid red;
color:#fff;
text-align:center;
line-height:3.2rem;
}
/*第二种
使用时要清除浮动*/
.two>span{
float:left;
}
/*第三种*/
.three>span{
display:inline-block;
}
</style>
</head>
<body>
<div class=" nav_left">
<span class="fashion">时尚商城</span>
<span class="fashion_phone">手机优购</span>
</div>
<div class="two">
<span class="fashion">时尚商城</span>
<span class="fashion_phone">手机优购</span>
</div>
<div class="three">
<span class="fashion">时尚商城</span>
<span class="fashion_phone">手机优购</span>
</div>
</body>
</html>
本文标题:解决span中间的空隙的多种方法
本文链接:https://www.haomeiwen.com/subject/llmqbftx.html
网友评论