CSS sets the list style and creates the navigation menu implementation code

CSS sets the list style and creates the navigation menu implementation code

1. Set the list symbol

list-style-type: attribute; //Set list style

list-style-type: none; //clear style

There are many properties you can try yourself: circle, disc, decimal. . . .

2. Set list picture symbols

Set image symbol for ul,ol

ul,ol{
     list-style-image: url("li.png")
 }

Code:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Set list symbols</title>
<style type="text/css">
ul,ol{
 list-style-image: url("li.png")
}
</style>
</head>
<body>
<ul>
 <li>Home</li>
 <li>My Blog</li>
 <li style="list-style-image: url('image.png')">My photo album</li>
 <li>Leave a message</li>
 <li>About me</li>
</ul>
<ol>
 <li>Home</li>
 <li>My Blog</li>
 <li>My photo album</li>
 <li>Leave a message</li>
 <li>About me</li>
</ol>
</body>
</html>

Display effect:

3. Create a simple navigation menu

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Creating a simple navigation menu</title>
<style type="text/css">
#navigation{
/* width: 120px; */
 
 font-family: Arial;
 font-size: 14px;
 text-align: center;
}
#navigation ul{
 list-style-type: none;
 margin:0px;
 padding:0px;
}
#navigation li{
 border-bottom:1px solid #9F9FED; /* Add underline */ 
 float: left; /* horizontal arrangement */
} 
#navigation li a{
 display: block;
 height:1em;
 padding: 5px 5px 5px 0.5em;
 text-decoration: none;
}
#navigation li a:link,#navigation li a:visited{
 background-color: #1136c1;
 color: #FFF;
}
#navigation li a:hover{ /* When the mouse passes by*/
 background-color: #002099; /* Change background */
 color: #ff0; /* Change text color */
}
</style>
</head>
<body>
<div id="navigation">
 <ul>
  <li><a href="#">Home</a></li>
  <li><a href="#">My Blog</a></li>
  <li><a href="#">My Photo Album</a></li>
  <li><a href="#">Leave a message</a></li>
  <li><a href="#">About Me</a></li>
 </ul>
</div>
</body>
</html> 

Summarize

The above is the CSS list style setting and navigation menu creation implementation code introduced by the editor. 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!

<<:  W3C Tutorial (4): W3C XHTML Activities

>>:  A detailed discussion of components in Vue

Recommend

Implementation of vue3.0+vant3.0 rapid project construction

Table of contents 1. Project Construction 2. Vue3...

HTML web page hyperlink tag

HTML web page hyperlink tag learning tutorial lin...

MySQL database table partitioning considerations [recommended]

Table partitioning is different from database par...

Vue implements the method example of tab routing switching component

Preface This article introduces the use of vue-ro...

MySQL InnoDB row_id boundary overflow verification method steps

background I talked to my classmates about a boun...

Manually install mysql5.7.10 on Ubuntu

This tutorial shares the process of manually inst...

Implementation of vue-nuxt login authentication

Table of contents introduce Link start Continue t...

Detailed process of installing the docker plugin in IntelliJ IDEA (2018 version)

Table of contents 1. Development Environment 2. I...

Implementation of CSS loading effect Pac-Man

emmm the name is just a random guess 2333 Preface...

Some key points of website visual design

From handicraft design to graphic design to web de...

Navicat for MySQL 11 Registration Code\Activation Code Summary

Recommended reading: Navicat12.1 series cracking ...

CSS achieves colorful and smart shadow effects

background Ever wondered how to create a shadow e...

Detailed explanation of command to view log files in Linux environment

Table of contents Preface 1. cat command: 2. more...