Home > Web Front-end > HTML Tutorial > Display and hide HTML elements through display or visibility_HTML/Xhtml_Web page production

Display and hide HTML elements through display or visibility_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:39:05
Original
1552 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





visibility: The position of the element is still occupied

DIV 3

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template