How to stop horizontal scrolling?

I wrote a file using html and javascript.

That the vertical scroll should be there, but I want to stop the horizontal scroll.

How can i do this?

+3
source share
6 answers

Sarfraz already mentioned overflow-xthat it is one of the answers, although it means (as said!) That everything that would be to the right is now inaccessible to the user. There are use cases for this, but it’s generally not advisable to disturb content that the user cannot access.

: ? , . , , , , , (, ). , :

<p>...lots of text here...</p>

... :

<p style='width: 1200px'>...lots of text here...</p>

... 1200 .

, , , , , , .

+8

:

overflow-x:hidden;

:

overflow:auto;
overflow-x:hidden;

, , .

+6

, , . 960 , , 1024 x 768 . - . - :

<html>
<head>
</head>
<body>
  <div style="width:960px; margin:0 auto;">
     ... The rest of your content goes here ...
  </div>
</body>
</html>

:

http://www.fivefingercoding.com/web-design/is-there-a-perfect-web-design-width

, , . , , , . , :

<table style="width:99999px;"> ... table stuff ... </table>
0

, , .

0

html.body div ;

div.sample{ width:100%;}

sample div / /

0

If you are viewing the file using a browser, you can set the width of the content by specifying it as a percentage.

-2
source

Source: https://habr.com/ru/post/1748789/


All Articles