Get the App
SLTechnology News&Howtos  ›  Development  › 

How to hide the navigation tab of html5

Shulou Source: shulou.com Published: 2022-06-01 23:53:38 10月15日 Update

This article introduces the knowledge of "how to hide the navigation tags of html5". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

In html5, you can use the hidden attribute to hide the navigation tag, which specifies that the specified element is hidden, which is a new attribute in html5 with a syntax of ".".

The operating environment of this tutorial: windows10 system, HTML5 version, Dell G3 computer.

How to hide the navigation tab of html5

If you want to hide the navigation tag in html5, you can take advantage of the hidden attribute.

The hidden attribute specifies that the element is hidden.

Hidden elements are not displayed.

If you use this attribute, the element is hidden.

The hidden property can be set so that the user cannot see an element until certain conditions are met (such as selecting a check box, and so on). You can then use JavaScript to remove the hidden attribute, making the element visible.

Examples are as follows:

Document * {margin:0;padding: 0;} ul {list-style-type: none; overflow: hidden; position: fixed; top: 0; width: 100%;} li {float: left;} li a {display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none } li a:hover {background-color: red;} Home news contact us dynamically about us

When no hidden attribute is added to the navigation element, the output is as follows

After adding the hidden attribute to the navigation bar element, the output is as follows:

This is the end of the content of "how to hide the navigation tags of html5". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Attributes elements navigation tags output content more knowledge results practicality learning and then function dynamics dilemma reality that is situations tutorials articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux Shulou Information Microsoft MariaDB