Several HTML tags come with a property called "visibility." One element that has this style is the div tag. The div tag is a container that holds text and images in a certain location on a web page. You can use this tag to hide text on a web page. Surround your blocks of text with a div tag and it is hidden from users. This is useful when you want to make a menu or dynamic page that does not show information until a user clicks a button or link.
Video of the Day
Open your web page in a text editor. This can be something simple like Notepad or more advanced HTML editors such as Notepad++ or Visual Studio.
Place a div tag in the section of the page where you want to place the text. The code below places a div tag with the visibility property set to hidden:
Enter some text within the div tag. For testing purposes, enter "My Hidden Text" within the tag. Your code should look like the below:
Save the file and open it with your web browser. No text is shown in the web browser even though it can be seen in the rendered code.