I want to have a slightly rotated line separating my site content, But when I try to rotate the <hr>
line, it never ends properly, leaving ugly gaps.
How could I get lines that go through the whole screen?
.dividingline {
transform: rotate(-5deg);
overflow: hidden;
}
<div class="dividingline">
<hr style="margin-top: 50px; margin-bottom: 0px; width:200%; position:relative; left:-1200px; border-width:10px; border-style: solid; border-color: #e82010; border-radius: 24px; background-color:#e82010; height:30px">
<hr style="margin-bottom: 0px; margin-top: 0px; width:200%; position:relative; left:-1200px; border-width:10px; border-style: solid; border-color: #fe5b20; border-radius: 24px; background-color:#fe5b20; height:30px">
<hr style="margin-bottom: 50px; margin-top: 0px; width:200%; position:relative; left:-1200px; border-width:10px; border-style: solid; border-color: #f26c8f; border-radius: 24px; background-color:#f26c8f; height:30px">
</div>
2
Answers
How about this?
Use
vw
units (less than 100) so that once rotated the element does not overflow and then remove the positioning.This is now responsive and I’ve centered it as well.