Search code examples
htmllayoutalignmentfooter

Centering an element within a footer?


I'm fairly knew to this. A recent update has thrown my 'special recent posts pro' widget out of alignment in my footer. I've moved the item to an 'above footer' container. I was hoping to make it fixed width, say 1000px, and center it within the container.

www.richclarkimages.co.uk

Any ideas on how to achieve this?


Solution

  • There are several issues with the markup on your site. I see you are using WordPress, so I am guessing that you did not write all the code yourself.

    As far as I can tell, the element with the class .srp-widget.container has its width set to 1000px, so to center that in the parent container, only a little CSS is required.

    .srp-widget.container {
        margin-left: auto;
        margin-right: auto;
    }