Home > Web Front-end > CSS Tutorial > Build a vertical navigation bar using CSS

Build a vertical navigation bar using CSS

WBOY
Release: 2023-09-02 08:25:02
forward
878 people have browsed it

使用 CSS 构建垂直导航栏

To build a vertical navigation bar, you can try running the following code.

Example

Live Demonstration

<!DOCTYPE html>
<html>
   <head>
      <style>
         ul {
            list-style-type: none;
            margin: 5;
            padding: 5;
         }
         li a {
            display: block;
            width: 70px;
            background-color: orange;
         }
      </style>
   </head>
   <body>
      <ul>
         <li><a href = "#home">Home</a></li>
         <li><a href = "#company">Company</a></li>
         <li><a href = "#product">Product</a></li>
         <li><a href = "#services">Services</a></li>
         <li><a href = "#contact">Contact</a></li>
      </ul>
   </body>
</html>
Copy after login

The above is the detailed content of Build a vertical navigation bar using CSS. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template