⭐span 是一个文字标签等于小括号
span的添加,不会对文字造成任何的变化,目的作用在于,将一段文字中的某一个或者几个文字进行样式的更改,可以用span尽心包裹,然后设置span格式
代码实例:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.car{
width: 110px;
height: 35px;
border: 1px solid black ;
font-size: 14px;
line-height: 35px ;
text-indent: 32px;
background: url(./img/buy.png) no-repeat 8px 11px;
background-color:#ffffff;
}
span{
color: blue;
font-size: 20px;
font-family: "宋体";
}
</style>
</head>
<body>
<div class="car">我的<span>购</span>物车</div>
</body>
</html>
结果展示: