Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3 columns vertically center in a row Bootstrap 3

I am using Bootstrap 3 in a static website. In the footer I have 3 columns col-lg-4 in a row.

My footer looks like:

screenshot

What I need is center of the row with 3 columns like below:

screenshot

This is my code:

<!-- libraries for demo: -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- actual code: -->
<div class="container">
    <div class="row">
        <div class="col-xs-4">
            <ul class="links">
                <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
           </ul>
        </div>
        <div class="col-xs-4">
            <ul class="links">
                <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
           </ul>
        </div>
        <div class="col-xs-4">
            <ul class="links">
                <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
                 <li><a>Sub Menu</a></li>
           </ul>
        </div>
    </div>
</div>

Fiddle: Here

like image 608
Maria Jeysingh Anbu Avatar asked Nov 06 '15 09:11

Maria Jeysingh Anbu


1 Answers

well if your columns are each 2 bootstrap-columns wide you could use the following:

<div class="col-lg-2 col-lg-offset-3">
  Menu 1
</div>
<div class="col-lg-2">
  Menu 2
</div>
<div class="col-lg-2">
  Menu 3
</div>
like image 171
My1 Avatar answered Oct 13 '22 18:10

My1