Home > Article > Web Front-end > How to show hidden elements in css
In CSS, you can use the display attribute to display hidden elements. You only need to add the "display:block" style to the hidden elements. The display attribute specifies the type of element that should be generated. When the value is block, it means that the hidden element will be displayed.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Create a new html file, named test.html, to explain how to display CSS hidden elements.
In the test.html file, use the p tag to create two lines of text for testing.
In the test.html file, add a class attribute to the first p tag. The attribute value is mytest. It is mainly used to set the style of the p tag through this class.
##In the test.html file, write the tag. The css style of the page will be written in this within the label. In the css tag, set the css style of the p tag through class(mytest), and set the display attribute to none to hide the content of the p tag. In the hidden p tag, use style to set the style of the p tag, and set the display attribute to block to display the hidden p tag. Open the test.html file in the browser to check the effect. Recommended learning:The above is the detailed content of How to show hidden elements in css. For more information, please follow other related articles on the PHP Chinese website!