Issue
Is there an easy way to draw a diagonal line through a div? The line should go from the top left to bottom right.
.container {
width: 100%;
height: 100%;
}
<div class="container">
<div class="line"></div>
</div>
Solution
Use a gradient
.container {
width: 200px;
height: 100px;
background: linear-gradient(to bottom left,#0000 49%,red ,#0000 51%);
border: 1px solid;
}
<div class="container">
</div>
Answered By - Temani Afif
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.