Forums

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

Home Forums CSS Centering a Div Element Re: Centering a Div Element

#46847
Chris Coyier
Keymaster

Text, by default, should be wrapping down onto the next line automatically inside your div, you don’t need to do anything special to achieve that. The two exceptions are that somewhere else in the stylesheet "white-space" got set to "no-wrap", which prevents text from breaking down onto the next line. Or, the text doesn’t have any spaces in it. For example, really really long URL’s. Those have a habit of wanting to stick together on one line and busting outside of div’s.