0% found this document useful (0 votes)
19 views9 pages

HTML Basic Tags Explained

The document discusses basic HTML tags including <br /> for line breaks, <center> for centering content, and <hr /> for horizontal lines, emphasizing their usage and syntax requirements. It also introduces the non-breaking space entity &nbsp; that prevents line breaks between words. Examples of each tag are provided to illustrate their functionality in HTML documents.

Uploaded by

Gaurabh Kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views9 pages

HTML Basic Tags Explained

The document discusses basic HTML tags including <br /> for line breaks, <center> for centering content, and <hr /> for horizontal lines, emphasizing their usage and syntax requirements. It also introduces the non-breaking space entity &nbsp; that prevents line breaks between words. Examples of each tag are provided to illustrate their functionality in HTML documents.

Uploaded by

Gaurabh Kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

HTML basic tags contd..

 Whenever you use the <br /> tag or element, anything following it
starts from the next line.

 Thistag is an example of an empty element, where you do not need


opening and closing tags, as there is nothing to go in between them.

 The <br /> tag has a space between the characters br and the forward
slash.

 Note: If you omit this space, older browsers will have trouble
rendering the line break, while if you miss the forward slash character
and just use <br> it is not valid in XHTML

<br> tag(line break tag)


<!DOCTYPE html>
<html>
<head>
<title>Line Break Example</title>
</head>
<body>
<p>Hello<br />
GEHU<br />
Transforming dreams into reality<br>
CSE </p>
</body>
</html>

<br> tag Example


Centering Content
You can use <center> tag to put any content in the center of the page or any table
cell.
Example
<!DOCTYPE html>
<html>
<head>
<title>Centring Content Example</title>
</head>
<body>
<p>Welcome to GEHU </p>
<center><p>Welcome to CSE Department</p></center>
</body>
</html>

<center> tag
Horizontal Lines

 Horizontal lines are used to visually break-up sections of a document.


The <hr> tag creates a line from the current position in the document to
the right margin and breaks the line accordingly.

 For example, you may want to give a line between two paragraphs

 Again <hr /> tag is an example of the empty element, where you do not
need opening and closing tags, as there is nothing to go in between them.

 The <hr /> element has a space between the characters hr and the
forward slash. If you omit this space, older browsers will have trouble
rendering the horizontal line, while if you miss the forward slash
character and just use <hr> it is not valid in XHTML
<hr> tag
<!DOCTYPE html>
<html>
<head>
<title>Horizontal Line Example</title>
</head>

<body>
<p>This is paragraph one and should be on top</p>
<hr />
<p>This is paragraph two and should be at bottom</p>
</body>
</html>

Example
 A commonly used entity in HTML is the non-breaking space:
&nbsp;

 A non-breaking space is a space that will not break into a new line.

 Two words separated by a non-breaking space will stick together


(not break into a new line).

Non-breaking Spaces(nbsp)
<!DOCTYPE html>
<html>
<head>
<title>Nonbreaking Spaces Example</title>
</head>
<body> <p>Here is the example of showing non breaking space. Here
is the example of showing non breaking space. Here is the example
of showing non breaking space. Here is the example of showing
nbps. "Non&nbsp;breaking&nbsp;space."</p> </body>
</html>

Example
Thank you

You might also like