Whats the CSS to make something go to the next line in the page?

The Solution to Whats the CSS to make something go to the next line in the page? is


There are two options that I can think of, but without more details, I can't be sure which is the better:

#elementId {
    display: block;
}

This will force the element to a 'new line' if it's not on the same line as a floated element.

#elementId {
     clear: both;
}

This will force the element to clear the floats, and move to a 'new line.'

In the case of the element being on the same line as another that has position of fixed or absolute nothing will, so far as I know, force a 'new line,' as those elements are removed from the document's normal flow.

~ Answered on 2011-04-03 07:41:51


Most Viewed Questions: