This article shares the specific code for Bootstrap to realize the tab tag switching effect for your reference. The specific content is as follows
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href="css/bootstrap.min.css" /> <script type="text/javascript" src="js/jquery.min.js" ></script> <script type="text/javascript" src="js/bootstrap.min.js" ></script> </head> <body> <nav role="navigation"> <div> <div> <button data-toggle="collapse" data-target=".navbar-collapse"> <span></span> <span></span> <span></span> </button> <a href="#"> <img src="img/logo.jpg" style="height: 50px;margin-top: -15px;"/> </a> </div> <div> <ul> <li><a href="#">Home</a></li> <li><a href="#">News</a></li> <li><a href="#">Product</a></li> <li> <a href="#">Data-toggle="dropdown">Services<span></span></a> <ul> <li><a href="#">Customer Service Online</a></li> <li></li> <li><a href="#">FAQ</a></li> <li></li> <li><a href="#">Address Phone</a></li> </li> </li> </li> <li><a href="#">Mall</a></li> </ul> <div> <a href="#">Login</a> <a href="#">Register</a> <input type="text" placeholder="Please enter keywords"/> <button>Search</button> </div> </div> </nav> <div style="height: 60px;"></div> <div> <div> <div> <ul id="mytab"> <li> <a href="#xw1" data-toggle='tab'>News1</a> </li> <li> <a href="#xw2" data-toggle='tab'>News2</a> </li> </ul> <div> <div id="xw1"> <p><a href="#">Illustrated TPP Moments: There has always been something that has not been confessed in the United States (picture)</a><span>2015-10-6</span></p> <p><a href="#">Illustrated TPP Moments: There has always been something that has not been confessed in the United States (picture)</a><span>2015-10-6</span></p> <p><a href="#">Illustrated TPP Moments: There has been something that has not been confessed in the United States (picture)</a><span>2015-10-6</span></p> <p><a href="#">Illustrated TPP Moments: There has always been something that has not been confessed in the United States (picture)</a><span>2015-10-6</span></p> </div> <div id="xw2"> <p><a href="#">Illustrated TPP Moments: There has been something that has not been confessed in the United States (picture)</a><span>2015-10-5</span></p> <p><a href="#">Illustrated TPP Moments: There has been something that has not been confessed in the United States (picture)</a><span>2015-10-6</span></p> <p><a href="#">Illustrated TPP Moments: There has been something that has not been confessed in the United States (picture)</a><span>2015-10-6</span></p> </div> </div> </div> <div> <ul> <li><a href="#">Best Practice 1</a></li> <li><a href="#">Best Practice 2</a></li> <li ><a href="#">Best Practice 3</a></li> </div> <div> <img src="img/logo.jpg" /> <div> <h3><a>Bootstrap</a></h3> <p>This is a short explanatory text for the above application. </p> </div> </div> </div> <div> <img src="img/logo.jpg" /> <div> <h3><a>Bootstrap</a></h3> <p>This is a short explanatory text for the above application. </p> </div> </div> </div> <div> <img src="img/logo.jpg" /> <div> <h3><a>Bootstrap</a></h3> <p>This is a short explanatory text for the above application. </p> </div> </div> </div> <div> <img src="img/logo.jpg" /> <div> <h3><a>Bootstrap</a></h3> <p>This is a short explanatory text for the above application. </p> </div> </div> </div> <div> <img src="img/logo.jpg" /> <div> <h3><a>Bootstrap</a></h3> <p>This is a short explanatory text for the above application. </p> </div> </div> </div> <div> <img src="img/logo.jpg" /> <div> <h3><a>Bootstrap</a></h3> <p>This is a short explanatory text for the above application. </p> </div> </div> <div> <div> <h3>This is a new development method for html5</h3> </div> <p>look look</p> </div> </div> </div> </div> </div> <script> //$('#mytab a[href="#xw2"]').tab('show'); //#$('#mytab a:last').tab('show'); $('#mytab a:eq(1)').tab('show') </script> </body></html>If you still want to study in depth, you can click here to study and attach 3 exciting topics to you:
Bootstrap learning tutorial
Bootstrap practical tutorial
Bootstrap plug-in usage tutorial
The above is all about this article, and I hope it will be helpful for everyone to learn Bootstrap programming.