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

Build a vertical navigation bar using CSS

WBOY
WBOYforward
2023-09-02 08:25:02782browse

使用 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>

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete