- The parent of an element has a defined width
-
auto says make up the parent's width or total width required for this element
by using this value to make up the difference
-
margin and the element's width can be specified as auto
-
padding and border are set to specified values
- If the width is over-constrained, all set to specific values that do not add up to parent's width,
margin-right is forced to auto
- If margin-left and margin-right set to auto they have equal values
p (margin-left:25%;margin-right:25%; width:50%}
A way to centre a paragraph
p (margin-left:auto;margin-right:auto; width:50%}
Correct way to centre a paragraph