Home  >  Article  >  Web Front-end  >  What are the values ​​of the overflow attribute in css?

What are the values ​​of the overflow attribute in css?

下次还敢
下次还敢Original
2024-04-28 15:18:12618browse

CSS overflow attribute controls the processing method when the element content overflows, respectively: 1. visible: display beyond the boundary; 2. hidden: hide the overflow content; 3. scroll: add a scroll bar; 4. auto: based on Scrollbars need to be added (only for fixed width and height elements).

What are the values ​​of the overflow attribute in css?

CSS overflow property value

The overflow property controls how the element content overflows the container. Its values ​​are as follows:

1. visible

Allows content to exceed the boundaries of the container.

2. hidden

The overflowing content is clipped and will not be displayed outside the container.

3. scroll

Add a scroll bar within the container to allow users to view overflowing content.

4. auto

The default is "visible". If the content overflows, the browser adds scroll bars as needed.

When overflow is used for elements with fixed width and height, the behavior is as follows:

  • visible: Content exceeds the bounds of the container show.
  • hidden: Overflow content is clipped.
  • scroll: Display horizontal or vertical scroll bars (depending on overflow direction).
  • auto: Only display scroll bars when the content overflows.

When overflow is used for elements with dynamic width and height, the behavior is as follows:

  • visible: Content Display beyond the boundaries of the container.
  • hidden: Overflow content is clipped.
  • scroll: Scroll bars will not be displayed.
  • auto: Scroll bars will not be displayed.

The above is the detailed content of What are the values ​​of the overflow attribute in css?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn