0

I am designing a website i.e. website I have used Bootstrap 3 example layout to start and added my own css in another file. But I am unable to center align the Navbar. I have tried col-md-10 & col-md-offset. Also tried adding col-centered css with margin-left:auto; & margin-right:auto. But unable to get it right.

Please help.

عثمان غني
  • 2,786
  • 4
  • 52
  • 79
  • Please add meaningful code and a problem description here. Don't just link to the site that needs fixing - otherwise, this question will lose any value to future visitors once the problem is solved. Posting a [Short, Self Contained, Correct Example (SSCCE)](http://www.sscce.org/) that demonstrates your problem would help you get better answers. For more info, see [Something on my web site doesn't work. Can I just paste a link to it?](http://meta.stackexchange.com/questions/125997/) Thanks! – j08691 Jun 28 '15 at 19:31
  • I have mentioned that navbar is not center aligned. – عثمان غني Jun 28 '15 at 19:32
  • Possible duplicate, http://stackoverflow.com/questions/10939481/center-the-nav-in-twitter-bootstrap – Spade Jun 28 '15 at 19:43

2 Answers2

2

Change HTML

<div style="width:100%; padding-left:0; padding-right:0;" class="container">

to

<div class="container">

CSS

#navbar-wrapper {
  background: #BECAD5;
}

.navbar {
  border: 0 none;
  width: 80%;
  margin: 0 auto;
}

PS: I have seen so much inconsistency in your code. Please correct them. The above solution worked based on hacking the code. It could have been much simpler if your code was more organized.

Centered Navbar

m4n0
  • 29,823
  • 27
  • 76
  • 89
-1

use the bootstrap class

.center-block

to whatever you want to center align.

Mocolicious
  • 315
  • 1
  • 10