Without further ado, I'll go straight to the code (Newbie: There's really nothing much to say) <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>Navigation Bar</title> <style type="text/css"> #nav{ width:100%; height:39px; margin:0px; background:#808080 } #nav ul li{ margin:5px 10px; float:left; list-style:none; } #nav ul li a{ float:left; padding:0px 16px; <!--margin:auto;--> color:#ffffff; font-size:15px; } </style> </head> <body> <div id="nav"> <ul> <li ><a href="#">Home</a></li> <li ><a href="#">Friends</a></li> <li ><a href="#">Shop</a></li> <li ><a href="#">Download the client</a></li> </ul> </div> </body> </html> The main thing is to use CSS (Cascading Style Sheets) to format the HTML content (not very good at expressing); You can directly use the identifier to set the format of the element; to format an element with the id nav, add # in front of it; to modify the format of class="nav", add "." in front of nav. I am not very familiar with these three applications, so I will not talk about them in detail. I hope some experts can give me some guidance, or someone can discuss with me. CSS code can be written in the head of the HTML document using the start Here is a simple navigation bar CSS code, not much, just embedded in the head The above is a way to reference CSS: embedded style sheet --------------------------------------------------------------------------------------------------------------------------- If there are a lot of CSS codes, you can write the codes directly in the CSS file, and then use the link tag to introduce the style sheet CSS in the head of the HTML file. The second way to quote the above facts: external style sheet (nowadays web pages are complicated, this method is more commonly used) Another type is inline style sheets, which will not be explained here. Summarize The above is the editor's introduction to the simple navigation bar function implemented by html+css. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: CentOS 7 cannot access the Internet after modifying the network card
>>: The Complete List of MIME Types
Use pure CSS to change the background color of a ...
This article example shares the specific code of ...
Mirroring is also one of the core components of D...
Table of contents nonsense text The first router/...
This article uses an example to describe the simp...
1. Download the installation script - composer-se...
Preview versions of Safari (Technology Preview 10...
Starting from MySQL 8.0.16, you can set a passwor...
1. According to the online tutorial, the installa...
Preface Everyone knows that the partition field m...
Query mysql operation information show status -- ...
Table of contents JS Three Mountains Synchronous ...
The advantage of the master-slave synchronization...
Uninstall the old version of MySQL (skip this ste...
In order to save installation time, I used the of...