How to change the width of a native bootstrap navbar?

0

Good morning.

I need to change the width of a native navbar. I simply picked up the boostrap.com site and pasted it into my template.blade.php but it is occupying the entire screen and needs to reduce its width. How?

<nav class="navbar navbar-default">

                

    
asked by anonymous 06.01.2017 / 11:05

1 answer

3

You can do the following:

.navbar.custom {
  width: 50%;  
  margin: 0 auto;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<nav class="navbar navbar-default custom">

In your nav add the custom class, then in your css add:

.navbar.custom {
  width: 50%;  
  margin: 0 auto;
}

Change the value of width to find the ideal size!

    
06.01.2017 / 11:52