Несколько примеров как зачеркнуть текст по диагонали с помощью псевдоэлементов CSS :before
и :after
.
del {
font-size: 40px;
position: relative;
color: #000;
text-decoration: none;
}
del:before {
content: "";
border-bottom: 3px solid red;
position: absolute;
width: 100%;
height: 50%;
transform: rotate(12deg);
}
del {
font-size: 40px;
position: relative;
color: #000;
text-decoration: none;
}
del:before {
content: "";
border-bottom: 3px solid red;
position: absolute;
width: 100%;
height: 50%;
transform: rotate(-12deg);
}
del {
font-size: 40px;
position: relative;
color: #000;
text-decoration: none;
}
del:before {
content: "";
border-bottom: 3px solid red;
position: absolute;
width: 100%;
height: 50%;
transform: rotate(-12deg);
left: 0;
}
del:after {
content: "";
border-bottom: 3px solid red;
position: absolute;
width: 100%;
height: 50%;
transform: rotate(12deg);
left: 0;
}