<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
p:nth-child(1){
/*若线跟文本颜色一样的直接设置color属性*/
color: red;
text-decoration: overline;
}
p:nth-child(2){
text-decoration: underline;
}
p:nth-child(3){
/*若线跟文本颜色不一样的话, 在p标签里面写个span标签, p设置底边框, span再定位上去*/
border-bottom: 1px solid #999;
position: relative;
color: #ffda44;
display: inline-block;
width: 60px;
}
p:nth-child(3) span{
margin-top: -13px;
position: absolute;
top: 5px;
left: 6px;
}
</style>
</head>
<body>
<p>上划线</p>
<p>下划线</p>
<p><span>删除线</span></p>
</body>
</html>