Clip the left/right edge of the content in the div element - if it overflows the content area of the element:
div { overflow-x:hidden; }
Browser support
All major browsers support the overflow-x attribute.
Note: The overflow-x attribute does not work correctly in IE8 and earlier browsers.
Definition and Usage
The overflow-x attribute specifies whether to clip the left/right edges of the content - if it overflows the element's content area.
overflow-X | overflow-y
The properties of overflow-x and overflow-y were originally properties independently developed by IE browser. It was later adopted and standardized by CSS3. overflow-x is mainly used to define the shearing of horizontal content overflow, and overflow-y is mainly used to define the shearing of vertical content overflow
[Note] If the overflow-x and overflow-y values The same is equivalent to overflow. If the overflow-x and overflow-y values are different, and one of the values is explicitly set to visible or is not set, the default is visible, and the other value is a non-visible value. The visible value will be reset to auto
Value: visible | hidden | scroll | auto | inherit | no-display | no-content
Initial value: visible
Applies to: block-level elements, replacement elements, table cells
Inheritance: None
Attribute
visible
The content of the element is also visible outside the element box
[Note 1] The containing block of the element in IE6-browser will be extended so that its excess content can be wrapped
.box{ height: 200px; width: 200px; background-color: lightgreen; }.in{ width: 300px; height: 100px; background-color: lightblue; }
<p> </p><p></p>
The picture on the left is IE6-browser, the picture on the right is other browsers
![]() |
![]() |
## [Note 2] There is a bug in the buttons of IE7-browser (including
The picture on the left shows the default situation, and the picture on the right shows the situation after setting overflow![]() |
![]() |
If the content is clipped, the browser will display scroll bars In order to view the rest of the content
[Note] For general browsers, and
//IE7-浏览器 html{overflow-y: scroll;}//其他浏览器 html{overflow: auto;}//去除页面默认滚动条 html{overflow: hidden;}
scroll
The content of the element will be in the element box Clipping at the border, but the browser will display scroll bars to view the rest of the content
[Note] Firefox and IE8+ browsers have a missing
padding-bottomphenomenon when using overflow:scroll or auto.
.box{ width: 100px; height: 100px; padding: 50px; background-color: pink; overflow:scroll; }.in{ width: 100px; height: 200px; background-color: lightgreen; }
<p> </p><p></p>
The picture on the left shows the situation of the chrome browser, and the picture on the right shows the situation of the firefox browser
![]() |
![]() |
The above is the detailed content of Share CSS overflow overflow example tutorial. For more information, please follow other related articles on the PHP Chinese website!

In a perfect world, our projects would have unlimited resources and time. Our teams would begin coding with well thought out and highly refined UX designs.

Oh, the Many Ways to Make Triangular Breadcrumb Ribbons

SVG has its own set of elements, attributes and properties to the extent that inline SVG code can get long and complex. By leveraging CSS and some of the forthcoming features of the SVG 2 specification, we can reduce that code for cleaner markup.

You might not know this, but JavaScript has stealthily accumulated quite a number of observers in recent times, and Intersection Observer is a part of that

We may not need to throw out all CSS animations. Remember, it’s prefers-reduced-motion, not prefers-no-motion.

PWA (Progressive Web Apps) have been with us for some time now. Yet, each time I try explaining it to clients, the same question pops up: "Will my users be

It's extremely surprising to me that HTML has never had any way to include other HTML files within it. Nor does there seem to be anything on the horizon that

There are a lot of different ways to use SVG. Depending on which way, the tactic for recoloring that SVG in different states or conditions — :hover,


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools