- Trending Categories
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
Tabs With Dropdown Bootstrap Example
To create tabs with Bootstrap, use the .nav and .nav-tabs classes. With that use the .dropdown-menu class.
- Start with a basic unordered list with the base class of .nav
- Add the class .nav-tabs.
- Now add an unordered list with a .dropdown-menu class.
You can try to run the following code to create tabs with drop-down −
Example
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body style = "background: #FADBD8;"> <h2>Website</h2> <ul class = "nav nav-tabs"> <li class = "active"><a href = "#">Home</a></li> <li><a href = "#">About</a></li> <li class = "dropdown"> <a class = "dropdown-toggle" data-toggle = "dropdown" href = "#"> Products <span class = "caret"></span> </a> <ul class = "dropdown-menu"> <li><a href = "#">Online Compiler</a></li> <li><a href = "#">Image Editor</a></li> <li><a href = "#">Document Viewer</a></li> </ul> </li> <li><a href = "#">Services</a></li> <li><a href = "#">Contact</a></li> </ul> </body> </html>
- Related Articles
- Vertically stack tabs with Bootstrap
- Create Dropdown menu with Bootstrap
- Disable a dropdown item with Bootstrap
- Center tabs in Bootstrap
- Align Dropdown to the right with Bootstrap
- Bootstrap dropdown class
- Using Bootstrap nav-tabs class
- Bootstrap class dropdown-header
- Bootstrap 4 .card-header-tabs class
- Pills with Dropdowns Bootstrap Example
- Add header to label sections in dropdown menu with Bootstrap
- Right align a Bootstrap dropdown menu
- How to use Bootstrap Dropdown Plugins
- Create a caret arrow icon that represents dropdown button with Bootstrap
- Separate links in the dropdown menu with a thin horizontal border with Bootstrap

Advertisements