MMDT1021 Chapter 22 Notes - page 2

Creating a Line Break

Here we have four lines without <br /> tags.
Code Result
This is line one.
This is line two.
This is line three.
This is line four.
This is line one. This is line two. This is line three. This is line four.

Here we have the same code with <br> tags.
Code Result
This is line one.<br />
This is line two.<br />
This is line three.<br />
This is line four.<br />
This is line one.
This is line two.
This is line three.
This is line four.

Keeping Lines Together

Code Page
You can keep long lines together with the <nobr> tag. This is a non-standard tag that seems to work. Result
Source
You can do the same thing by using the &nbsp; (non-breaking space) instead of spaces. This is a standard tag that seems to work.  Remember, the semicolon is required! Result
Source

 

Creating Discretionary Line Breaks

Code Page
You can keep long lines together with the <nobr> tag. You can then use the <wbr> tag to set discretionary line breaks. These breaks then occur only if needed to 'fit inside the window'. This is a non-standard tag that seems to work better in Internet Explorer than Netscape Navigator. Result
Source