---
title: "How to make Navbar using CSS?"  
description: "How to make Navbar using CSS?"  
author: "Ravi Vishwakarma"  
published: 2021-07-19  
canonical: https://answers.mindstick.com/qa/93778/how-to-make-navbar-using-css  
category: "web application"  
tags: ["css cascading style sheets", "html5", "javascript"]  
reading_time: 3 minutes  

---

# How to make Navbar using CSS?

How to make [Navbar](https://www.mindstick.com/forum/1331/expand-the-navbar-group-of-nabarcontrol-on-button-click-using-devexpress-navbarcontrol) using [CSS](https://www.mindstick.com/articles/12349/a-step-by-step-guide-to-making-pure-css-tooltips)?

## Answers

### Answer by Ethan Karla

<!DOCTYPE html> <html lang='en' xmlns='http://www.w3.org/1999/xhtml'> <head> <meta charset='utf-8'/> <meta name='viewport' content='width=device-width, initial-scale=1.0'> <title></title> <style> body { margin:0px; padding:0px; } div { margin:0px; padding:5px; background-color:orange; width:100%; text-align:center; box-sizing:border-box; font-size:30px; letter-spacing:5px; color:white; font-weight:bold; font-family:Arial,Verdana; } ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 8px 20px; text-decoration: none; font-family:Arial,Verdana; } li a:hover:not(.active) { background-color: #111; } .active { background-color: #111; } .active:hover { background-color:orange; } </style> </head> <body> <div > MindStick pvt. ltd. </div> <ul> <li><a href='https://www.mindstick.com/'>Home</a></li> <li><a href='https://www.mindstick.com/Services'>Services</a></li> <li><a href='https://www.mindstick.com/Products'>Product</a></li> <li><a href='https://www.mindstick.com/developersection/users'>Users</a></li> <li><a href='https://www.mindstick.com/developersection/job'>Job</a></li> <li><a href='https://www.mindstick.com/career'>Career</a></li> <li style='float: right'><a class='active' href='https://www.mindstick.com/home/aboutus'>About</a></li> </ul> </body> </html> \

### Answer by SundarLal Sharma

#### Navigation Bars

Having easy-to-use navigation is important for any web site.

With CSS you can transform boring HTML menus into good-looking navigation bars.

```html
<!DOCTYPE html>
<html>
<head>
<style>
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

li {
  float: left;
}

li a {
  display: block;
  padding: 8px;
  background-color: #dddddd;
}
</style>
</head>
<body>

<ul>
  <li><a href='#home'>Home</a></li>
  <li><a href='#news'>News</a></li>
  <li><a href='#contact'>Contact</a></li>
  <li><a href='#about'>About</a></li>
</ul>

<p><b>Note:</b> If a !DOCTYPE is not specified, floating items can produce unexpected results.</p>
<p>A background color is added to the links to show the link area. The whole link area is clickable, not just the text.</p>
<p><b>Note:</b> overflow:hidden is added to the ul element to prevent li elements from going outside of the list.</p>

</body>
</html>
```

### Answer by user

#### Navigation Bars

Having easy-to-use navigation is important for any web site.

With CSS you can transform boring HTML menus into good-looking navigation bars.

```html
<!DOCTYPE html>
<html>
<head>
<style>
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

li {
  float: left;
}

li a {
  display: block;
  padding: 8px;
  background-color: #dddddd;
}
</style>
</head>
<body>

<ul>
  <li><a href='#home'>Home</a></li>
  <li><a href='#news'>News</a></li>
  <li><a href='#contact'>Contact</a></li>
  <li><a href='#about'>About</a></li>
</ul>

<p><b>Note:</b> If a !DOCTYPE is not specified, floating items can produce unexpected results.</p>
<p>A background color is added to the links to show the link area. The whole link area is clickable, not just the text.</p>
<p><b>Note:</b> overflow:hidden is added to the ul element to prevent li elements from going outside of the list.</p>

</body>
</html>
```

### Answer by user

#### Navigation Bars tab

Having easy-to-use navigation is important for any web site.

With CSS you can transform boring HTML menus into good-looking navigation bars.

```html
<!DOCTYPE html>
<html>
<head>
<style>
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

li {
  float: left;
}

li a {
  display: block;
  padding: 8px;
  background-color: #dddddd;
}
</style>
</head>
<body>

<ul>
  <li><a href='#home'>Home</a></li>
  <li><a href='#news'>News</a></li>
  <li><a href='#contact'>Contact</a></li>
  <li><a href='#about'>About</a></li>
</ul>

<p><b>Note:</b> If a !DOCTYPE is not specified, floating items can produce unexpected results.</p>
<p>A background color is added to the links to show the link area. The whole link area is clickable, not just the text.</p>
<p><b>Note:</b> overflow:hidden is added to the ul element to prevent li elements from going outside of the list.</p>

</body>
</html>
```


---

Original Source: https://answers.mindstick.com/qa/93778/how-to-make-navbar-using-css

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
