Use differences between display and visibility

Source: Internet
Author: User
This time to bring you the use of display and visibility differences, the use of display and visibility notes, the following is the actual case, together to see.

Visibility hidden objects also retain the physical space occupied by the object display, and display is not retained.

Vilibility:hidden (hidden), visible (display) style= "Vislbility:hidden"

Display:none (Hidden), block (display) style= "Display:none"

You can save the following code to see the effect.

Specific steps:

code example:

< P style= "border:1px solid #000; background: #eee" >< span style= "Width:200;height:200;visibility:hidden" > The </span>←ss property is Visibility:hidden object </p><br>< p style= "border:1px solid #000; background: #666" >< span style= "Width:200;height:200;display:none" ></span>←ss property for Display:none objects </p>

Special Tips

Controlling the hidden object with the visibility property also occupies its position when it is displayed, while display does not.

Special Instructions

The Display property sets how elements are displayed, the corresponding script attributes are display, the optional values are none, block and inline, and the values are described as follows:

None hides the element and does not preserve space when the element is displayed.

Block blocks the way the element is displayed.

Inline displays elements in embedded mode.

The Inline-block object is displayed as an inline element, but all child objects are displayed as block elements, and adjacent inline elements are displayed on the same line, allowing spaces.

LIST-ITEM displays block elements as list objects, and you can add item punctuation. (Requires ie6.0+ support)

Table-header-group displays the element as a table header group, which is equivalent to the THEAD element.

Table-footer-group displays the element as a table footer group, which is equivalent to the TFOOT element.

The Visibility property sets whether the element is displayed, the corresponding script attribute is visibility, the optional value is inherit, hidden, and visible, and the values are described as follows:

Inherit inherits the visibility property setting of the parent element.

Hidden hides the element, but retains the space it occupies.

The visible display element (the default value).

Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!

Recommended reading:

CSS background-attachment use of the detailed

CSS to make ripple animations

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.