
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to add link dividers in a Navigation Bar with CSS
To add link dividers in a Navigation Bar, use the border-right property for the <li> element.
Example
<!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; } li { float: left; border-right: 1px solid white; } li a { display: block; padding: 8px; background-color: orange; } li:last-child { border-right: none; } </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> </body> </html>
- Related Questions & Answers
- How to create a navigation bar with a centred link/logo with CSS?
- Set style to current link in a Navigation Bar with CSS
- How to create a navigation bar with equal-width navigation links with CSS?
- How to create a dropdown navigation bar with CSS?
- Build a Vertical Navigation Bar with CSS
- Create a Horizontal Navigation Bar with CSS
- Center links in a Navigation Bar with CSS
- How to create a responsive navigation bar with dropdown in CSS?
- How to create different dividers with CSS?
- How to resize a navigation bar on scroll with CSS and JavaScript?
- How to add a navigation menu on an image with CSS?
- How to Create an On Scroll Fixed Navigation Bar with CSS?
- How to slide down a navigation bar on scroll with CSS and JavaScript?
- How to create a navigation bar with left-aligned and right-aligned links with CSS?
- Build Horizontal Navigation Bar with Floating List Items in CSS
Advertisements