KEMBAR78
Session2 HTML JR | PDF | Html | Html Element
0% found this document useful (0 votes)
12 views14 pages

Session2 HTML JR

This document provides an overview of HTML elements, including headings, paragraphs, line breaks, horizontal rules, and comments. It explains the structure of HTML elements, how to use specific tags like <h1> to <h6> for headings and <p> for paragraphs, and the purpose of tags like <br> and <hr>. Additionally, it highlights the use of comments in HTML for documentation and hiding content.

Uploaded by

eman3c2022
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)
12 views14 pages

Session2 HTML JR

This document provides an overview of HTML elements, including headings, paragraphs, line breaks, horizontal rules, and comments. It explains the structure of HTML elements, how to use specific tags like <h1> to <h6> for headings and <p> for paragraphs, and the purpose of tags like <br> and <hr>. Additionally, it highlights the use of comments in HTML for documentation and hiding content.

Uploaded by

eman3c2022
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
You are on page 1/ 14

HTML Session 2

HTML Elements
• An HTML element is defined by a start tag, some
content, and an end tag.

<tagname> Content goes here...


</tagname>

 Examples of some HTML


elements :

<h1> My first heading </h1>


<p> My first paragraph </p>
HTML Elements cont.
HTML Headings
• HTML headings are titles or subtitles that you want to display on a webpage.
• HTML headings are defined with the <h1> to <h6> tags.
• <h1> defines the most important heading.
• <h6> defines the least important heading.
 Example:

Heading

1
Heading 2
Heading 3
Heading 4
HTML Paragraphs
01
The HTML <p> element defines a paragraph.
.

A paragraph always starts on a new line, and is usually a


02. block of text.

A paragraph always starts on a new line, and browsers


03. automatically add some white space (a margin) before and
after a paragraph.
HTML Paragraphs cont.
With HTML, you cannot change the display by adding extra spaces
04. or extra lines in your HTML code.

The browser will automatically remove any extra spaces and lines
05. when the page is displayed:
HTML Paragraphs cont.
The Poem Problem
• This poem will display on one line with the <p>
element :
The Poem Problem Cont.
Solution - The HTML <pre> Element
• The HTML <pre> element defines preformatted text.

• The text inside a <pre> element is displayed in a fixed-width font and it


preserves both spaces and line breaks:
HTML Line Breaks
• The HTML <br> element defines a line break.
• Use <br> if you want a line break (a new line) without starting a new
paragraph.
• The <br> tag is an empty tag, which means that it has no end tag.
HTML Horizontal Rules
• The <hr> tag defines a thematic break in an HTML page, and is
most often displayed as a horizontal rule.
• The <hr> element is used to separate content (or define a
change) in an HTML page.
• The <hr> tag is an empty tag, which means that it has no end
tag.
HTML Comments
• HTML comments are not displayed in the browser, but they can help document
your HTML source code.

• You can add comments to your HTML source by using the following syntax .

• With comments you can place notifications and reminders in your HTML code .
HTML Comments Cont.
 Hide Content :
• Comments can be used to hide content.
• This can be helpful if you hide content temporarily.
• You can also hide more than one line. Everything between the <!-- and the -->
will be hidden from the display
Home work
 Make this Web page :

You might also like