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.