Andrew Kilburn Andrew Kilburn - 1 year ago 37
CSS Question

How to horizontally center a div with anchor links inside?

I've looked into this and follow a couple instructions and they don't seem to work.

Follow this link for the code:

I've tried

margin: 0 auto;
class) and
float: none;
on the parent div but I can't seem to get it to work. Can anyone help me center div in the middle of the page and tell me why it isn't working?

Expected outcome:

Except I do not want to use
to move it in to the middle

Answer Source

You can use col-offset:

        <div class="col-xs-12 col-md-12 home-buttons center-block" >
        <a href="#" class="col-xs-6 col-sm-4 col-md-2 HomepageBtn Animate col-sm-offset-2 col-md-offset-4" >
            <div class="tile-text">
                AP REVIEW
        <a href="#" class="col-xs-6 col-sm-4 col-md-2 HomepageBtn Animate">
            <div class="tile-text">
                VAT CHECKER