In HTML, you can use the style and "overflow-x" attributes to set the div to move horizontally and not display the scroll bar. When the value of the attribute is set to "hidden", the horizontal scrolling mechanism will not be provided. The syntax is: "
".
The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.
htmlHow to set the div horizontal scroll bar not to display
The overflow-x attribute specifies whether to clip the left/if it overflows the content area of the element Right margin content.
The syntax is:
overflow-x: visible|hidden|scroll|auto|no-display|no-content;
The parameters are expressed as follows:
The example is as follows:
<html>
<head>
<meta charset="utf-8">
<title>123</title>
<style>
div
{
width:110px;
height:110px;
border:thin solid black;
overflow-y:hidden;
}
</style>
</head>
<body>
<div style="overflow-x:hidden;"><p style="width:140px">
In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.
'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'
</p></div>
<p>Overflow-x指定是否要剪辑的左/右边缘的内容.</p>
<p>Overflow-y指定是否要剪辑的顶部/底部边缘的内容</p>
</body>
</html>
When When the style="overflow-x:hidden;" is not added to the div element, the output result is as follows:
The above example adds this style, and the output result is as follows :
Recommended tutorial: "html video tutorial"