• Resolved practical

    (@kit-grill)


    Hello all,

    i’ve tried many times with the css to align my footer center but can’t seem to,

    here’s the footer.php

    <div id="footer">© all content copyright
    </div>
    <?php wp_footer(); ?> 
    
    </body>
    
    </html>

    and the css for it

    #footer {
            position: relative;
    margin-top: -150px;
    height: 150px;
    clear:both;
    }

    website is here

    Any help would be much appreciated, I’m at a brickwall!
    thanks

Viewing 3 replies - 16 through 18 (of 18 total)
  • There must be a n extra closing div somewhere in the middle. Like within a post, or in the sidebar. The validation will only see that there’s an extra one, and show you that it’s found one (which is usually the last one it finds, not the one you need to know about). Finding stuff like this takes time. I usually copy the source code and paste it in a text editor and just start picking it apart until I find the culprit.

    Thread Starter practical

    (@kit-grill)

    ive managed to find the culprit. The footer text is now the same as the body text but it still wont align center.

    In your CSS, you have your footer set to position:absolute. That’s a no-no. It takes it out of the flow of the rest of the site and absolutely positions it where you tell it to (or the closest relatively positioned container it’s inside of, whatever comes first.)

    You also have the footer set as text-align:left.

    Remove the absolute positioning and set the text to align center.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Footer won't align to center’ is closed to new replies.