- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set a border around navbar with CSS
To add a border around navbar, set border to <ul>
ul { border: 2px solid blue; }
Example
You can try to run the following code to set border
<!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 200px; border: 2px solid blue; } li a { display: block; background-color: #F0E7E7; } .active { background-color: #4CAF50; color: white; } li { text-align: center; border-bottom: 1px solid #555; } </style> </head> <body> <ul> <li><a href = "#home">Home</a></li> <li><a href = "#company" class = "active">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>
Advertisements