centering problem

  • Anonymous

    #5123

    Hi,

    I contact you because I have difficulties to center some items (see the homepage of my website in progress)

    For example, I added three buttons (Called “GORGE”) and there are always a little more left than right.

    I tried several things without success

    Can you explain how to solve this problem?

    And thank you again for your excellent work.

    Mod

    Kenneth John Odle

    #30748

    You have all of them wrapped in a <div> with an ID of centerdiv.

    1) Change that ID to a class.

    2) Add this to your child theme stylesheet or custom CSS option:

    .centerdiv {
    padding-left: auto;
    padding-right: auto;
    }

    3) You have each of those images wrapped in this: <div style="float: left;">. That is why they are all going to the left. Remove the <div> around each button. Just add the buttons:

    <div class="centerdiv">
    <a href="http://centre-orl.fr/wp-content/uploads/2012/07/PATHOLOGIE_GORGE-1.png">
    </a><a href="http://centre-orl.fr/wp-content/uploads/2012/07/PATHOLOGIE_GORGE-1.png">
    </a><a href="http://centre-orl.fr/wp-content/uploads/2012/07/PATHOLOGIE_GORGE-1.png">
    </div></a>

    Anonymous

    #30749

    HI, thanks for your answer, but if i do this, images are aligned vertically, while I want them side by side.

    In addition, even if there is only one image in this div, it moves to the left and not the center of the page

    Have I missed something?

    Thanks for your time.

    ronangelo

    #30750

    Remove all the <br> inside the centerdiv and add text align

    .centerdiv {
    margin: 0 auto;
    text-align: center;
    }

    Anonymous

    #30751

    Thanks a lot!

    I did not think that the
    centerdiv had an impact.

    Thank you very much for helping.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!