Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizPlease log in to access this content. You will be redirected to the login page shortly.
LoginHow to center Pills in Bootstrap?
Web Development Bootstrap in Web Development 3 years ago
The .nav-justified class is used in Bootstrap to CENTER pills.
The following is an example:
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Pills</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h3>Centered Pills</h3> <p><strong>Note:</strong> Resize the browser window to see the effect. Items LOOK stacked if the screen size if less than 768px</p> <ul class="nav nav-pills nav-justified"> <li class="ACTIVE"><a href="#">HOME</a></li> <li><a href="#">AboutUs</a></li> <li><a href="#">COMPANY</a></li> </ul> </div> </body> </html>The output when the screen size is less than 768px. The pills look stacked:
The output when the screen size is more than 768px:
Posted on 31 May 2022, this text provides information on Web Development related to Bootstrap in Web Development. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.