Ron
Ron

Reputation: 918

Simple bootstrap working but doesnt look right

This is my first try using bootstrap. I am just trying to get a basic menu bar working. From what I see everything works fine, but just doesnt look ok. I tried to switch out the css with a new download, but still doesnt seem to fix anything.

This is the HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/bootstrap-theme.min.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container">

      <div class="row">
          <nav class="navbar">
            <div class="navbar-inner">
                <a href="#" class="brand">test</a>
              <ul class="nav">
                <li><a href="#">Item1</a></li>
                <li class="divider-vertical"></li>
                <li><a href="#">Item1</a></li>
                <li class="divider-vertical"></li>
                <li><a href="#">Item1</a></li>
                <li class="divider-vertical"></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Connect<b class="caret"></b></a>

                    <ul class="dropdown-menu">
                        <li><a href="#">Item1</a></li>
                        <li><a href="#">Item1</a></li>
                        <li><a href="#">Item1</a></li>
                    </ul>
                </li>

              </ul>
            </div>
          </nav>
      </div>
    </div>


    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

Nothing complex. Got the basic structure from Bootstrap website. Just added the new menu.

It looks like this

enter image description here

I have checked the CSS files to be in the right place and also the bootstrap js file.

Upvotes: 0

Views: 962

Answers (1)

Diego Montoya
Diego Montoya

Reputation: 139

Add the class navbar-brand to the first 'a' tag

<a href="#" class="brand navbar-brand">test</a>

And add the class navbar-nav to the first 'ul' tag:

<ul class="nav navbar-nav ">

With these changes the example looks better.

I can't post images yet, but in the next link you can see how the example look after this changes:

enter image description here

Upvotes: 1

Related Questions