WordPress.org

Ready to get started?Download WordPress

Forums

Centering Images on Links Sidebar (7 posts)

  1. KrisGibson
    Member
    Posted 4 years ago #

    I am still quite new to WordPress, and am having a little difficulty getting something to work for me. I am using images for links in the sidebars, but the images are left aligned, and I would like them to be centered. I have searched the help sections, but cannot solve this problem. Can anyone point me in the right direction? Its probably really simple and easy to do, but it is annoying the life out of me!

    Many thanks in advance,

    Kris

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Site url?

  3. KrisGibson
    Member
    Posted 4 years ago #

    Sorry, wasn't sure if it would be allowed.

    http://canes88.x10hosting.com/kris

    I'm setting up this as a test site before we put it on the actual one.

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Try adding:

    .BlockContent-body img {
    	display: block;
    	margin-left: auto;
    	margin-right: auto;
    }

    to style.css

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    I think you might catch more images then intended with that Esmi... it threw off the top block for me...

    The blogroll class is present on the ones that are to be targeted i think..

    This may be more suited.
    .blogroll li {text-align:center}

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Darn! I thought I'd checked for any other other instances of BlockContent-body. Problem with using the blogroll class is that it won't cover images that might be added via another widget. The images in the top block could be reset using:

    .BlockContent-body #adboxes img {
    	display: inline;
    }
  7. KrisGibson
    Member
    Posted 4 years ago #

    Thanks so much guys! I've went down esmi's route and its worked a treat! Many thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.