Home >Web Front-end >CSS Tutorial >Detailed introduction to CSS overflow property

Detailed introduction to CSS overflow property

高洛峰
高洛峰Original
2017-03-31 11:09:312325browse

I encountered a multiple-choice question during the interview today. The title is as follows:

CSS overflow属性详细介绍

I was not sure at the time. I came back to check the information. According to the original words of W3C, I should choose True.

Browser support

All major browsers support the overflow attribute.

Note: The attribute value "inherit" is not supported by any version of Internet Explorer (including IE8).

Definition and Usage

The overflow attribute specifies what happens when content overflows the element box.

Description

This attribute defines how content that overflows the content area of ​​the element will be handled. If the value is scroll, the user agent provides a scrolling mechanism whether required or not. Therefore, it is possible that scrollbars will appear even if everything fits inside the element box.

##Inheritance: noVersion: CSS2JavaScript Syntax: object.style.overflow="scroll"
Default: visible
Possible values

ValueDescriptionvisibleDefault value. The content will not be trimmed and will be rendered outside the element box. hiddenThe content will be trimmed and the remaining content will be invisible. scrollThe content will be trimmed, but the browser will display scroll bars to view the remaining content. autoIf content is trimmed, the browser displays scroll bars to view the remaining content. inheritSpecifies that the value of the overflow attribute should be inherited from the parent element.

The above is the detailed content of Detailed introduction to CSS overflow property. 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