I’m trying to use a skewed background to separate the divs, for now I’m using the “transform: skew(Xdeg, Xdeg);” in the main div and a negative value to the tansform in the div inside that has all the contents.
The problem is there’s always this white space in the end of the divs that appears if the screen is too big:
If you wanted to change the starting angles, you could switch the declarations to be like this:
&#two, &#four
&::before
content ''
width 200%
height 100vh
position absolute
top 0px
right 0px
transform-origin top right
transform rotate(5deg)
z-index 10
&::after
content ''
width 200%
height 100vh
position absolute
bottom 0px
right 0px
transform-origin bottom right
transform rotate(-5deg)
z-index 10
Note: I did use stylus to create this, however, you can view the compiled CSS by clicking the dropdown top right of the CSS pane and choosing “View Compiled CSS”.
EDIT: Just noticed a bug with the width of the pseudo-elements . Just fixing it now.
The design looks EXACTLY like what I was looking for, thanks, I just didn’t understood anything of the code :/, I don’t know if I did it right, I tried to add a
, and the white-space appeared again, I don’t know if I placed it the right way because of the kind of code you wrote. But in the design part, again, It’s exactly how I wanted to make the divs stay above each other.
It’s probably not the best code in the world so feel free to ask any questions. Also, don’t be afraid to play around, tweak it, inspect the console etc. All part of the fun
Oh I’m sorry I must have used some wrong word, English is not my mother language, what I tried to say was that your code worked perfectly, the design looks exactly what I had in mind, but I didn’t understand probably because of Pug compiler, and I’m still new at Web-Development, I tried to add a
just after the #one, but I don’t even know if I used the right syntax for it, after I did so, the white-space appeared again.
Oh sorry I see, you can do the same with the html pane as you can with the CSS pane, click the link dropdown top-right and choose “View compile HTML” to view the actual HTML.