Marginal or boot menu

here i have a new problem with my bootsrap filled menu;

The problem is with the margins or padding on the left, the menu doesn't line up with the logo and the rest of the content; I've tried a lot of CSS changes and no success!

Here is the page http://www.deluxe-art.fr/test/index.html#

Here is the CSS

.header-top 	{ background-color:#FFF;}

navbar-header	{ z-index:1000!important;}

/*Disable bar effect of the menu in a small device*/
.navbar-collapse	{ border:0!important; box-shadow:none!important;}

.navbar-nav > li > a {color:#7a6b66!important; font-size:13px!important; margin-left:0px!important;
	-webkit-transition: color .2s ease-in;
    -moz-transition: color .1s ease-in;
    -o-transition: color .1s ease-in;
    transition: color .1s ease-in;}
	

	
.navbar-nav > li > a:hover {color:#231815!important;}
.navbar-nav > .active > a {background-color:#fff!important; color:#231815!important;}
.dropdown-menu > ul > li { background-color:#000!important;}
      

<header>
    
    <nav class="navbar navbar-default header-top">
    <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>
    </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">
        	<li class="active"><a href="index.html">MENU</a></li>
            <li><a href="#">MENU</a></li>
            <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">MENU<span class="caret"></span></a>
                <ul class="dropdown-menu" role="menu">
                <li><a href="#">MENU</a></li>
                <li class="divider"></li>
                <li><a href="#">MENU</a></li>
                <li><a href="#">MENU</a></li>
                <li><a href="#">MENU</a></li>
                <li><a href="#">MENU</a></li>
                <li><a href="#">MENU</a></li>
                </ul>
                
            </li>
            <li><a href="#">MENU</a></li>
            <li><a href="#">MENU</a></li>
            <li><a href="#">MENU</a></li>
            <li><a href="#">MENU</a></li>
        </ul>
    </div>
    
    </div>
    </nav>
    
</header>
      

Run codeHide result


+3


source to share


2 answers


you may try



#bs-example-navbar-collapse-1.navbar-nav { margin: 0px 0px 0px -30px; }

      

0


source


<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" 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="#">
                    <img src="http://placehold.it/150x50&text=Logo" alt="">
                </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">
                    <li>
                        <a href="#">About</a>
                    </li>
                    <li>
                        <a href="#">Services</a>
                    </li>
                    <li>
                        <a href="#">Contact</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>

      

this is the nav tag inside your header. now apply CSS like this ...

body {
    padding-top: 70px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */
}

.navbar-fixed-top .nav {
    padding: 15px 0;
}

.navbar-fixed-top .navbar-brand {
    padding: 0 15px;
}

@media(min-width:768px) {
    body {
        padding-top: 100px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */
    }

    .navbar-fixed-top .navbar-brand {
        padding: 15px 0;
    }
}

      



you do not need to apply margin and add-on separately. And this is a bad technique when you are working with the bootstrap framework.

Try it, it will work.

0


source







All Articles