hidden paragraph

]. The hidden attribute can hide elements and hidden elements will not be displayed."/> hidden paragraph

]. The hidden attribute can hide elements and hidden elements will not be displayed.">

Home  >  Article  >  Web Front-end  >  How to hide styles in html

How to hide styles in html

王林
王林Original
2021-06-23 11:26:393014browse

htmlThe method to hide the style is to add the hidden attribute to the element, such as [

]. The hidden attribute can hide elements and hidden elements will not be displayed.

How to hide styles in html

The operating environment of this article: windows10 system, html 5, thinkpad t480 computer.

The hidden attribute specifies that the element is hidden. Hidden elements will not be displayed.

The hidden attribute can be set so that users can only see an element when certain conditions are met (such as checking a check box, etc.). You can then use JavaScript to remove the hidden attribute, making the element visible.

Code example:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head>
<body>

<p hidden="hidden">这是一段隐藏的段落。</p>
<p>这是一段可见的段落。</p>

</body>
</html>

Running effect:

How to hide styles in html

## Related video tutorial sharing:

html video tutorial

The above is the detailed content of How to hide styles in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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