1

How can I center my div inside a separate div with a class footer navbar-inverse navbar-fixed-bottom in bootstrap? Here's my exact code.

<div class="footer navbar-inverse navbar-fixed-bottom">
    <div class="center-block">
        <div class="small navbar-text text-center">
            First Line<br />
            Second Line<br />
            Third Line
        </div>
    </div>
</div>

Image in Fullscreen:

enter image description here

But if I resize the width of my browser, the position is fine.

enter image description here enter image description here

Blunderfest
  • 1,834
  • 1
  • 27
  • 45
SkyDrive
  • 1,395
  • 4
  • 14
  • 24

1 Answers1

4

.navbar-text was floating to the left.

Fixed it for ya :)

bryce
  • 2,639
  • 1
  • 13
  • 17
  • Thanks! It worked. [I was wondering if this is the same with solution here?](http://stackoverflow.com/a/114549/1204929) – SkyDrive Jul 07 '14 at 01:24
  • `margin: 0 auto` should be enough to center anything, the issue you were having was that there was a floating rule which overrides any margins. so look out for those. – bryce Jul 07 '14 at 01:26