I was making a light saber in CSS. The code is
div.handle
{
height:10px;
width:100px;
background-color:black;
display: inline-block;
border-radius: 0 4px 4px 0;
border-spacing: 0;
border-collapse: collapse;
}
div.sword
{
height:6px;
width:400px;
background-color:white;
display: inline-block;
border-radius: 3px;
border-spacing: 0;
border-collapse: collapse;
margin-top: 1px;
margin-bottom: 1px;
text-decoration: line-through;
}
div.red
{
box-shadow: 0 0 10px red;
border:1px solid red;
}
<div class = "handle"></div><div class = "sword red strike"></div>
I want to strikethrough the light saber completely.
The text-decoration: line-through;
property holds good only for text inside the div and not for the div only.
I saw Linethrough/strikethrough a whole HTML table row And tried it. But it doesn't work properly. So my question is "How do I strikethrough an empty div" using CSS.