नेवी लिंक्स, फॉर्म्स, बटन्स, या टेक्स्ट जैसे कंपोनेंट्स को यूटिलिटी क्लासेस .navbar-left या .navbar-right का उपयोग करके नेवबार में बाएँ या दाएँ संरेखित करने के लिए। दोनों वर्ग निर्दिष्ट दिशा में एक सीएसएस फ्लोट जोड़ देंगे।
उदाहरण
घटकों को संरेखित करने के लिए आप निम्न कोड चलाने का प्रयास कर सकते हैं
<!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> <nav class = "navbar navbar-default" role = "navigation" style="background: orange;"> <div class = "navbar-header"> <a class = "navbar-brand" href = "#">Alignment</a> </div> <div> <!--Left Align--> <ul class = "nav navbar-nav navbar-left"> <li class = "dropdown"> <a href = "#" class = "dropdown-toggle" data-toggle = "dropdown"> Java <b class = "caret"></b> </a> <ul class = "dropdown-menu"> <li><a href = "#">jmeter</a></li> <li><a href = "#">EJB</a></li> <li><a href = "#">Jasper Report</a></li> <li class = "divider"></li> <li><a href = "#">Separated link</a></li> <li class = "divider"></li> <li><a href = "#">One more separated link</a></li> </ul> </li> </ul> <form class = "navbar-form navbar-left" role = "search"> <button type = "submit" class = "btn btn-default">Left align-Submit Button</button> </form> <p class = "navbar-text navbar-left">Left align-Text</p> <!--Right Align--> <ul class = "nav navbar-nav navbar-right"> <li class = "dropdown"> <a href = "#" class = "dropdown-toggle" data-toggle = "dropdown"> Java <b class = "caret"></b> </a> <ul class = "dropdown-menu"> <li><a href = "#">jmeter</a></li> <li><a href = "#">EJB</a></li> <li><a href = "#">Jasper Report</a></li> <li class = "divider"></li> <li><a href = "#">Separated link</a></li> <li class = "divider"></li> <li><a href = "#">One more separated link</a></li> </ul> </li> </ul> <form class = "navbar-form navbar-right" role = "search"> <button type = "submit" class = "btn btn-default"> Right align-Submit Button </button> </form> <p class = "navbar-text navbar-right">Right align-Text</p> </div> </nav> </body> </html>