There are several correct ways to use the br tag in web documents.
In HTML, use the
tag for line breaks. We don't need to close
since it's an empty tag. To break a line, use
or
.
However, the
tag is used in other web documents such as XHTML. However, the
tag must have a space before the trailing /> as it helps XHTML render existing HTML user agents.
Text <br> text
The following are examples...
In the example below, we use the
tag to allow line breaks.
<!DOCTYPE html> <html> <body> <p>If you want to break a line <br> in a paragraph, <br> use the BR element in <br> your HTML document.</p> </body> </html>
In the example below, we use the
tag to allow line breaks.
<!DOCTYPE html> <html> <body> <p>If you want to break a line <br/> in a paragraph, <br/> use the BR element in <br/> your HTML document.</p> </body> </html>
The above is the detailed content of What is the correct way to use ',', ';' or ':' in HTML?. For more information, please follow other related articles on the PHP Chinese website!