DIV hiding technique

 In some cases, it is necessary to hide the DIV block. For example, when the webpage is first opened, it is not displayed. When users use certain options and then open applications such as the DIV block, there are two common techniques for hiding DIV, namely JavaScript Syntax or CSS hiding, this article will introduce CSS hiding techniques, you can achieve it in the following two ways.


CSS DIV hiding technique one

<div style="display:none">Content in the block</div>


CSS DIV hiding technique two

<div style="visibility:hidden">Content in the block</div>


What is the difference between these two usages? To put it simply, display:none means to hide the entire element containing the <div> tag, while visibility:hidden only hides the content in the block and retains the attributes of the <div> tag, in other words what the <div> tag occupies The block still exists, but the content is not displayed.

Post a Comment

0 Comments