Search code examples
htmlcssalignment

Aligning inline-blocks to the left


See this fiddle: JSfiddle

I have two divs that I am displaying as inline blocks. For some reason my divs are coming up as centered, even though I want them aligned to the left. How can I align my divs so that the match up with my .main div and are left aligned?

Thanks in advance!


Solution

  • Instead of centering all <body> contents, center just what you want to center:

    body {
        text-align: left; /* Just remove text-align:center */
    }
    h1, .click-nav {
        text-align: center;
    }
    

    Demo