What's the best way to center a list item using bootstrap?


Mohamed Sobhy

I have this problem how to solve?

https://www.dropbox.com/s/f9ex0h6knsisc4d/99.JPG?dl=0

Here is the HTML code:

HTML

<nav class="navbar navbar-default " role="navigation">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Hyper Design</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">

        <li class="active"><a href="#">Home</a></li>
        <li><a href="#">What We Do</a></li>
        <li><a href="#">Our Works</a></li>
        <li><a href="#">Contact</a></li>
        <li><a href="#">Link</a></li>
        <button type="button" class="btn btn-default navbar-btn">Sign in</button>

          </ul>
        </li>
      </ul>


        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
Sugans G

Try this:

Just use the class text-centerin the folded tag

<div class="collapse navbar-collapse text-center" id="bs-example-navbar-collapse-1">

demo

Related


What's the best way to center a list item using bootstrap?

Mohamed Sobhy I have this problem how to solve? Here is the HTML code: HTML <nav class="navbar navbar-default " role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header">

What's the best way to get Bootstrap popover content using Ajax?

Aycolmbro I'm developing a WordPress plugin that displays a "special button" on the front end via a WordPress shortcode. I'm using Bootstrap 4, the buttons use Bootstrap popovers, I need to retrieve/get the popover title and content from the database without r

What's the best way to change an array item?

Sinapcs What's the best way to change storage array elements in Redux? I have the following 3 possible solutions. In my opinion, the first two solutions are mutated states. Is it true? I would appreciate if you have a better solution. In this example, I have a

What's the best way to change an array item?

Sinapcs What's the best way to change storage array elements in Redux? I have the following 3 possible solutions. In my opinion, the first two solutions are mutated states. Is it true? I would appreciate if you have a better solution. In this example, I have a

What's the best way to change an array item?

Sinapcs What's the best way to change storage array elements in Redux? I have the following 3 possible solutions. In my opinion, the first two solutions are mutated states. Is it true? I would appreciate if you have a better solution. In this example, I have a

What's the best way to change an array item?

Sinapcs What's the best way to change storage array elements in Redux? I have the following 3 possible solutions. In my opinion, the first two solutions are mutated states. Is it true? I would appreciate if you have a better solution. In this example, I have a

What's the best way to refresh a list with Firebase

Jurdun : The way I currently update the list in the project is clearly not standard for the application. How can I refresh the list without clearing the list? This code is well written without any interruptions; however, once the user finishes editing, the lis

What's the best way to check if a variable is a list?

Ender Appearance I found the following three ways to check, but I don't know which is the best: x = ['Bla', 'Bla', 'Bla', 'etc'] if isinstance(a, list): print('Perfect!') if type(a) is list: print('Incredible!') if type(a) == type([]): print('Awesome!')

What's the best way to copy a list?

jacket: What's the best way to copy a list? I know the following methods, which one is better? Or is there another way? lst = ['one', 2, 3] lst1 = list(lst) lst2 = lst[:] import copy lst3 = copy.copy(lst) Mark Roddy: If you want a shallow copy (without cop

What's the best way to refresh a list with Firebase

Jurdun : The way I currently update the list in the project is clearly not standard for the application. How can I refresh the list without clearing the list? This code is well written without any interruptions; however, once the user finishes editing, the lis

What's the best way to refresh a list with Firebase

Jurdun : The way I currently update the list in the project is clearly not standard for the application. How can I refresh the list without clearing the list? This code is well written without any interruptions; however, once the user finishes editing, the lis

What's the best way to use a list on RuntimeExceptions?

Luiz Rossi I have an exception RuntimeExceptionthat extends a and I have a property List. public class ExperterBadRequestException extends RuntimeException { private final List<String> errors; Automatic evaluation tools such as Sonar throw a fatal error: the

What's the best way to refresh a list with Firebase

Jurdun : The way I currently update the list in the project is clearly not standard for the application. How can I refresh the list without clearing the list? This code is well written without any interruptions; however, once the user finishes editing, the lis

What's the best way to check if a variable is a list?

Ender Appearance I found the following three ways to check, but I don't know which is the best: x = ['Bla', 'Bla', 'Bla', 'etc'] if isinstance(a, list): print('Perfect!') if type(a) is list: print('Incredible!') if type(a) == type([]): print('Awesome!')

What's the best way to check if a variable is a list?

Ender Appearance I found the following three ways to check, but I don't know which is the best: x = ['Bla', 'Bla', 'Bla', 'etc'] if isinstance(a, list): print('Perfect!') if type(a) is list: print('Incredible!') if type(a) == type([]): print('Awesome!')

What's the best way to append a list to a dictionary?

prodriguez903 I am trying to build a list with 1 key with many values. I think the best way to do this is to point the key value to a list. However, I'm having trouble building the list inside the dictionary. num_items = len(decoded_data['data']['arrivalsAndDe

What's the best way to organize JPanels in a list?

mesh I find myself writing a lot of programs lately, all of which need to display some collection of data. The best looking way I've come up with so far is to make small JPanels with data about each item in the collection, and put them all into one large JPane

What's the best way to trim a list?

Riola I have a list of strings. It's generated elsewhere, but I'll generate it below to help describe this simplified example var list = new List<string>(); list.Add("Joe"); list.Add(""); list.Add("Bill"); list.Add("Bill"); list.Add(""); list.Add("Scott"); lis

What's the best way to trim a list?

Riola I have a list of strings. It's generated elsewhere, but I'll generate it below to help describe this simplified example var list = new List<string>(); list.Add("Joe"); list.Add(""); list.Add("Bill"); list.Add("Bill"); list.Add(""); list.Add("Scott"); lis

What's the best way to list the size of / in the terminal?

Korgan Rivera I want to see the total space taken up /, but I don't know how to do it. I can use ls -haland aggregate subtotals, or I can use fdiskto tell me the size of that partition, but is there a better way? Chris Downer Are you asking about the total siz

What's the best way to copy a list?

jacket: What's the best way to copy a list? I know the following methods, which one is better? Or is there another way? lst = ['one', 2, 3] lst1 = list(lst) lst2 = lst[:] import copy lst3 = copy.copy(lst) Mark Roddy: If you want a shallow copy (without cop