Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Front-end of the website goes to a side when scrolling

I am creating a front-end using bootstrap. I created it completely. But when I scroll it vertically, it scrolls a bit horizontally as well and it goes to a side. I want it to be fixed horizontally. I want to scroll it vertically only.

Before it goes to a side

Before it goes to a side

After it goes to a side

enter image description here

I tried to figure this out in many ways. But I failed. What should I do to stop this scrolling horizontally?

like image 359
Buwaneka Sudheera Avatar asked Dec 07 '25 08:12

Buwaneka Sudheera


2 Answers

You have to hide overflow property of 'x' axis of body or your relevant element.

overflow-x: hidden;
overflow-y: auto;

'overflow-y: auto' is more user friendly than 'scroll'.

like image 112
S.M. Shakil Avatar answered Dec 09 '25 23:12

S.M. Shakil


use this to hide scrolling in x- direction

overflow-x:hidden;
 overflow-y:scroll;
like image 37
rakesh Avatar answered Dec 09 '25 22:12

rakesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!