Hide html elements through display or visibility_HTML/Xhtml_Web page production
WBOY
Release: 2016-05-16 16:37:16
Original
1961 people have browsed it
Sometimes we need to control whether the HTML elements in the Web page are displayed or hidden based on certain conditions, which can be achieved through display or visibility. Understand the difference between display and visibility through the following example. The simple example code is as follows:
Copy the code
The code is as follows:
Show and hide control of HTML elements
display: The position of the element is not occupied
DIV 1
DIV 2
visibility: The position of the element is still occupied
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