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

Home Forums Design CSS Centre and Left align Reply To: CSS Centre and Left align


Why is the green box filling the entire blue body?

It’s expanding to accommodate the contents (that’s what inline-blocks do), so it will let as many red blocks as possible fit along one line, pushing out its width to fit its own container (body) unless it is told otherwise, i.e. you cap it with a max-width, or restrict the width of what’s inside, etc.