FlerrElectronics FlerrElectronics - 1 year ago 71
CSS Question

aligning a line of text left in a paragraph? CSS/HTML

I have a line of text like so:

I am john doe blah blah blah.

How can I align it like so:

I am john doe
blah blah blah

Answer Source

Several ways:

  1. Set the width of the text container so that the desired line break occurs
  2. Use <br> where you want the line break
  3. Wrap each 'line' of text in a <span>, and style them with CSS for the desired effect.

The 'right' way really depends on context. Perhaps you could say more about that.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download