Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved]how to center my portfolio buttons

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #183282
    drotar
    Participant

    little help please. i just working on my portfolio page and am trying to center the portfolio buttons within the center div. i took out the image size on the html and gave each button 20% but it is not responding. tried margin: 0 auto; as well. no luck. what i have right now is on line 1614

    .hoverfx-effect {
    display: block;
    clear: both;
    float: none;
    border: orange solid 2px;
    }

    the site can be viewed at http://www.drotardesign.com/september14/work.html

    any suggestions would be greatly appreciated.

    #183301
    Paulie_D
    Member

    Buttons?

    What buttons?

    #183302
    shaneisme
    Participant

    Block elements by default are 100% of their parent’s width.

    Unless the element has another class that floats left or right, you don’t need float: none;.

    What you would need is to set a width less than 100%, and then give it a margin: 0 auto;, which means margin-top and margin-bottom are 0, while the browser will center the left and right margins based on the block element’s width compared to its parent.

    #183303
    drotar
    Participant

    hey shane,
    the fix was very simple text-align: center;

    thanks for taking the time.

    d

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.