Comparison of visibility and display attributes in css

Source: Internet
Author: User


Browser support

All mainstream browsers support the visibility attribute.

Note: internet explorer (including ie8) of any version does not support "inherit" or "collaps tutorial e" attribute values.


All mainstream browsers support the display attribute.

Note: internet explorer of any version (including ie8) "inherit", "inline-table", "run-in", "table", "table-caption", "table-cell", and "table-column" are not supported", "table-column-group", "table-row", and "table-row-group" attribute values.


Description
Display

This attribute defines the type of the display box generated by the element when the layout is created. For html and other document types, it is dangerous to use the display without caution, because it may violate the display hierarchies defined in html. For xml, because xml does not have the built-in hierarchical structure, all display is absolutely necessary.

Visibility

This attribute specifies whether to display the element box generated by an element. This means that the element still occupies its original space, but it can be completely invisible. The value collapse is used to delete columns or rows from the table layout.

Conclusion,

Display can hide an element without occupying space on the page. In visibility, the element cannot be seen and occupies space on the page.

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.