html - What does margin auto mean? -



html - What does margin auto mean? -

i checked mdn see means have auto value margin property , says: "auto replaced suitable value, e.g. can used centering of blocks."

but suitable value, , suitable what?

i tried myself experiments , saw if add together margin-left: auto, container goes right (like floating right):

#container { background: red; width: 120px; margin-left: auto; }

http://jsfiddle.net/sph2j6jx/

does mean adding margin auto "take space available"? , when add together both left , right margins centers div because tries take space left , right?

auto margins

depending upon circumstances, provision of auto value instructs browser render margin according value provided in own stylesheet. however, when such margin applied element meaningful width, auto margin instead causes of available space rendered whitespace.

from w3.org

html css margin

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -