How to Add Bootstrap Navbar to Blogger

来自freem
跳到导航 跳到搜索


To add a Bootstrap Navbar to your Blogger site, you can follow these steps:

1. First, you need to add the Bootstrap CSS and JS files to your Blogger site. You can either download the files from the official Bootstrap website or use a CDN link. To use a CDN link, add the following code to your site's HTML head section:

```html <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> ```

2. Next, you can create a new Navbar by adding the following HTML code to your site's header section:

```html <nav class="navbar navbar-expand-lg navbar-light bg-light">

 <a class="navbar-brand" href="#">Brand</a>
 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
   
 </button>

</nav> ```

3. You can customize the Navbar by adding your own links and content to the `

    ` element. You can also modify the Navbar's appearance by changing the classes and properties of the various elements. For example, you can change the Navbar's background color by modifying the `bg-light` class. 4. Finally, save your changes and refresh your Blogger site to see the new Navbar in action. Note: If you are using a Blogger template that already includes a Navbar, you may need to remove the existing Navbar code before adding the new Bootstrap Navbar code.