codescracker


html

HTML Line Breaks



« Previous Tutorial Next Tutorial »


Sometimes while writing the text, it may be required to have a line break at certain points. The BR element is used to define a line break in an HTML document.

HTML BR Element Attributes

The following table list the attributes of the BR element:

Attribute Purpose
class Defines the class name of element
id Defines the value of the id
style Defines an inline style of the element
title Provides an extra information about the element

HTML Line Break Example

Here is an example shows how to break a line using BR element in HTML.

<!DOCTYPE html>
<html>
<head>
	<title>HTML Line Break Example</title>
</head>
<body>

<p>This is <br />
HTML Line Break Example <br />
shows how to break the line <br />
using the BR element in HTML.</p>

</body>
</html>

Here is the output displayed by the above HTML line break example code:

html line breaks

Here is another example also demonstrates line breaks in HTML.

<!DOCTYPE html>
<html>
<head>
	<title>HTML Line Break Example</title>
</head>
<body>

<p>Hello<br />
HTML,<br />
I am a Browser.</p>

</body>
</html>

Following is the sample output produced by the above HTML line break example:

HTML Line Break example

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test