Here, we are going to create menu tab using Bootstrap and HTML.
Basically, many times we have a requirement to create different divs which can display different data under that particular div as shown in the above image. It can be done by a couple of different ways but I mostly
prefer bootstrap as it is a bit easy to use and we have already predefined classes which can be grabbed easily and can be played around with.
So, here we are using HTML and Bootstrap only that can be put on any HTML page which will display the desired result.
Steps
Create new HTML page.
Add a reference to the Bootstrap on the HTML page.
Put HTML code on the page of different div section.
To make it easier I have provided complete code below which you can pick and put on your HTML page to test functionality.
Code Section
First, put a reference to bootstrap and its CSS on-page and later on our HTML will be consuming those classes.
Compete Code
- <!DOCTYPE html>
- <html>
-
- <head>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
- <!-- Optional theme -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
- <!-- Latest compiled and minified JavaScript -->
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
- <title>Bootstrap Menu Tab</title>
- </head>
-
- <body>
- <div class="container">
- <h2>Dynamic Tabs</h2>
- <ul class="nav nav-tabs">
- <li class="active"><a data-toggle="tab" href="#home">Home</a></li>
- <li><a data-toggle="tab" href="#menu1">Menu 1</a></li>
- <li><a data-toggle="tab" href="#menu2">Menu 2</a></li>
- <li><a data-toggle="tab" href="#menu3">Menu 3</a></li>
- </ul>
- <div class="tab-content">
- <div id="home" class="tab-pane fade in active">
- <h3>HOME</h3>
- <p>Home Page Contents</p>
- </div>
- <div id="menu1" class="tab-pane fade">
- <h3>Menu 1</h3>
- <p>Menu 1 Contents</p>
- </div>
- <div id="menu2" class="tab-pane fade">
- <h3>Menu 2</h3>
- <p>Menu 2 Contents</p>
- </div>
- <div id="menu3" class="tab-pane fade">
- <h3>Menu 3</h3>
- <p>Menu 3 Contents</p>
- </div>
- </div>
- </div>
- </body>
-
- </html>
| | | | | | | | | |
Text-to-speech function is limited to 200 characters
| | | | | | | | | |
Text-to-speech function is limited to 200 characters