<!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>
.father {
color: red;
text-decoration-line: line-through;
}
.son {
color: blue;
background-color: yellow;
text-decoration-line: none;
}
</style>
</head>
<body>
<span class="father">father
<span class="son">
son
</span>
</span>
</body>
</html>
出来的结果是这样的:
请问如何让 .son
部分没有删除线呢,就像这样:
update:
知道了,给 .son
设为 inline-block
就可以了!