Jump to content

How does margin 0 auto work?


XHTMLboy

Recommended Posts

Hi all, i just want to know what "margin: 0 auto;" does, all i know is that it's used for centering things. And i know the zero in "margin: 0 auto;" mean's the TOP and BOTTOM. But what does the auto do. What properties does the auto give to the browser to center things? Help would be apperceated as it's on my mind all the time and it's agrivating me now. And sorry for the crap spelling :)

Link to comment
Share on other sites

I believe thescientist explained that in your other thread....The auto just tells the browser to split up the available space evenly between the left and right side of the element. By available space, I mean any unoccupied horizontal space between the left and right edges of the parent container.
Oooh ok i just didn't see the other post so i posted this one before the other post :L, But i get the margin: 0 auto; now thankyou :)
Link to comment
Share on other sites

it just does.
Realistically, after you've been developing a while, some things become so automatic that "it just does" is the mindset you live in. One of the reasons I like coming here is that I'm constantly being reminded why a technique does what it does, which is useful on those occasions when it breaks and I need to know how to fix it.
Link to comment
Share on other sites

i know, i didn't mean to come off as overly sarcastic, even though i did answer the question in his other thread. it's been a heck of long week for me and looks to be a longer weekend. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...