I'm suffering from a vertical scrollbar
Guys, I'm struggling to center the content because it's creating a horizontal scrollbar, can you help me based on the code?
6 Replies
Horizontal or vertical? 🤔 If you mean vertical and if there is not supposed to be any scrolling at all, you can try to set the height of the body element to 100vh. The
vh
stands for viewport height and basically means the height of the current screen. I think this should do it.@Chaves this is the situation where
border: 1px solid red
can come into rescue. Apply border to everything and check which is overflowing.Might want to use outline instead, as that won't cause the layout to shift.
Do you have a reset with
Or at least
margin:0;
on your body? You can also use that gradient on your body without making a pseudo element and change
background-blend-mode: multiply;
And also when using
replaces
Edited for code formattingWow, I didn't know about this background-blend-mode property, I used it and it worked perfectly!
Guys, after deactivating some things, I realized that what was causing the vertical scrolling was a margin-top that I had applied to my nav