| Introduction SELECT A LETTER HTML ELEMENTS: Q<q> HTML ELEMENTS: S<s><samp><script><section><select><small><source><span><strike><strong><style><sub><summary><sup> HTML ELEMENTS: W<wbr> HTML ELEMENTS: X<xmp> | <br> Line BreaksSpecifying a line break will force a line to break at that point. For inline text, this means that the text will continue on the next line. For other elements before it, such as a paragraph or another line break, this will create an empty line, or space, between the previous line and the following line. This behavior, however, should be avoided as it is not semantically correct. A line break should only be used to break inline text (images, links, etc). Creating space above or below elements should be achieved using margins and padding in CSS. Some practical uses for a line break would include: starting a new line in a poem or postal address, breaking lines to make them all a certain number of characters long, or creating a break after a salutation. Notice on self-closing tags. In XHTML, this tag is required to be closed using <br />. In HTML 4, this is considered invalid syntax, but in HTML 5 it is acceptable to use this method of closing the tag, even though it is not required. Common Attributes
Note: These may not be the only attributes available to use with this element, but they are the most common attributes. Browser Compatibility
Default Style RulesThe following declarations in the default style sheet will affect this element. br:before { content: "\A"; white-space: pre-line } Example and ExplanationIn the following example, we have an image which is floated to the right side of a block of text. <img src="/path/to/image" alt="[img]" style="height: 100px; float: right" /> Say I want to add a small line of text, which is bolded, as the first line and have the rest of the text go below that. What we can do is add a line break after the first line of text so that the rest of it will start on the next line. <img src="/path/to/image" alt="[img]" style="height: 100px; float: right" /> The following continuation of this example is deprecated. Use the CSS clear property instead. After this text and image, we have more content below. We face a problem though. We only have a couple lines of text and an image floated to the right that expands to a height of 100 pixels. The text from the paragraph below is also being pushed to the left by the image, but we don't want it to do that. Our solution: clear the image. <img src="/path/to/image" alt="[img]" style="height: 100px; float: right" />
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Normal Element This element has not been changed recently and has no notes attached to it. | New Element This element was just added to the definitions in the most recent version. | Use Caution This element should be avoided without proper understanding and/or has a better alternative. |
Modified Behavior This element and/or its behavior has been modified from its original functionality. | Deprecated This element should be avoided since it has been deprecated in the most recent version. | Not Supported This element should not be used at all since it is no longer or was never supported. |