I am trying to make a website that has a slanted transition from one section to another. So far, I have been able to make a temporary solution using vh
. Here is what it looks like:
However, not only does the HTML code (below, along with the CSS) for the div look unprofessional, the slider bars are also visible.
<div id = "site">
<div class = "slant"> </div>
<div class = "stuff"> h </div>
</div>
.slant {
border-bottom: 200px solid rgb(var(--grey));
border-left: 99.6vw solid transparent;
position: absolute;
top: 65vh;
}
.stuff {
background: rgb(var(--grey));
position: absolute;
top: 85.5vh;
width: 99.6vw;
height: 100vh;
}
How could I improve my transition? By this, I mean how can I
- hide the scroll bars?
- have my elements fit perfectly, from left to right? Right now, there is a small gap on the left side of the transition, I want to remove it.
I want these elements to act as a background for more text to come later, which will be displayed above the transition.
Additionally, does anyone know any better practices to stretch an element's width to the view width in ways other than using "99.6vw
"? Or is such a method the preferred practice? Using 100vw gives me the scrollbar, so I reduced it slightly to 99.6.