Home › Forums › CSS › [Solved]how to center my portfolio buttons › Reply To: [Solved]how to center my portfolio buttons
September 16, 2014 at 2:05 pm
#183302
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.