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,854
  • 1
  • 28
  • 46
SkyDrive
  • 1,445
  • 4
  • 15
  • 24

1 Answers1

4

.navbar-text was floating to the left.

Fixed it for ya :)

bryce
  • 3,022
  • 1
  • 15
  • 19
  • 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