所以我想為一個大學(xué)項(xiàng)目制作一個網(wǎng)站,我需要用引導(dǎo)程序做一個導(dǎo)航欄。問題是,當(dāng)我向?qū)Ш綑谔砑有碌?nav-item 元素時,它們在 Y 軸上一個下一個對齊,并且我想水平對齊它們這就是我到現(xiàn)在為止所擁有的<!DOCTYPE html><html dir="ltr"> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> </head> <body> <nav class="navbar sticky-top navbar-dark bg-dark"> <a class="navbar-brand" href="#">Home Page</a> <ul class="nav navbar-nav mr-auto"> <li class="nav-item"> <a class="nav-link" href="#">Item One</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Item Two</a> </li> </ul> </nav> </body></html>這就是項(xiàng)目的顯示方式。如何將“項(xiàng)目一”與“項(xiàng)目一”對齊?和“項(xiàng)目二”水平的?
Bootstrap 導(dǎo)航欄兩個或多個項(xiàng)目對齊
婷婷同學(xué)_
2023-12-19 16:43:57