SlideShare a Scribd company logo
Lecture 2
What we will Learn
  • Heading tag: <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
  • <br> tag
  • Comment Tag: <!-- -- >


In the last lecture, we learned that the first tag on the web page we made is the HTML tag
which tells the browser that the document is HTML;

<html>

The last tag on the page is the end HTML tag, which tells the browser that the HTML bit
has finished;

</html>

Did you notice the '/' bit which tells the browser that this is the end tag, not the start?

Heading
Today we will learn about heading tag, which looks like <h1> or <h2> or <h3> or <h4>
or <h5> or <h6>.
Let us take an example to understand this tag.

<html>
<head>
<title >My Home Page with a heading</title>
</head>
<body>
<h1>My Heading</h1>
You write things here...
</body>
</html>

Write the code above and save as an .html file.
And the output looks something like this
My Heading
You write things here….


Take another example
<html>
<head>
<title >My Home Page with a heading</title>
</head>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<p>This is normal text!</p>
</body>
</html>

And the output is now,


Heading 1
Heading 2
Heading 3

Heading 4

Heading 5

Heading 6


This is normal text!

So, that was different ways of representing text.

Let us study about <br> tag. Please write the code below and save as an .html file
<html>
<head>
<title >My Home Page with a heading</title>
</head>
<body>
   My name is Harshit.
   I am studying at University of Suwon       .
</body>
</html>

The output will be
       My name is Harshit I am studying at University of Suwon

Q) Can any one tell me what is the problem with the above output?
A) When I wrote the code, I made two lines, one line contains my name and the other line
contains the name of University. But the output shows two lines one after the other.
So that means, HTML does not interpret the <return> key.
The solution to the above problem is <br> take. <br> tag is also called as blank rule. It
inserts a line.
<html>
<head>
<title >My Home Page with a heading</title>
</head>
<body>
   My name is Harshit. <br>
   I am studying at University of Suwon     .
</body>
</html>

 Now the output will be

My name is Harshit.
I am studying at University of Suwon.


Q What is the output for the code below?
<html>
<head>
<title >My Home Page with a heading</title>
</head>
<body>
   My name is Harshit. <br> I am studying at University of Suwon.
</body>
</html>

Answer)


Comments
Q) Why do we need comments?, infact every language supports comments, be it C,
C++ or Java?
Answer) When we write a page with a lot of code, and we come back to it later to wonder
what we did, it can be made easier if we have comments in the document which don't
show up in the browser.

For example


<html>
<head>
<!-- This is the title of my page
<title>My Page</title>
</head>
<body>
<!--This is the start of my page! As if I didn't know
that - I did say it was a trivial example!-->


<!--Start of my heading-->
<h1>My Heading - What my page is about.</h1>
<!--End of my heading-->

</body>

So the output is


My Heading - What my page is about.
Everthing contained in <!-- -- > is not visible on the browser.

More Related Content

PDF
Modulo4- Html-Guia
PPTX
HTML Introduction, HTML History, HTML Uses, HTML benifits
PPTX
H T M L Tutorial
POTX
Introduction to PHP - Slide 1
PPTX
Basic HTML
PPT
PPTX
Demo lecture ppt
PPT
Formatting your web page
Modulo4- Html-Guia
HTML Introduction, HTML History, HTML Uses, HTML benifits
H T M L Tutorial
Introduction to PHP - Slide 1
Basic HTML
Demo lecture ppt
Formatting your web page

What's hot (20)

PPTX
Html.ppt
PPT
HTML_Slideshow1
PPTX
Html
PDF
3. tutorial html web desain
DOC
Html basics 3 font align
 
PPT
PPTX
Html and its tags
PDF
Best HTML Training &Coaching in Ambala
PPTX
Introducing HTML
PPTX
215077679 introduction to HTML
PPTX
Very basic intro to HTML
PPTX
How to create basic webpage
PPT
Creating your first web page
PPT
1. html introduction
PDF
Html For Bloggers
PPTX
Html introduction by ikram niaz
PPTX
HTML Lesson 1
PPTX
Html coding
PPT
Introduction to Html
Html.ppt
HTML_Slideshow1
Html
3. tutorial html web desain
Html basics 3 font align
 
Html and its tags
Best HTML Training &Coaching in Ambala
Introducing HTML
215077679 introduction to HTML
Very basic intro to HTML
How to create basic webpage
Creating your first web page
1. html introduction
Html For Bloggers
Html introduction by ikram niaz
HTML Lesson 1
Html coding
Introduction to Html
Ad

Similar to Html basics 1 (20)

PDF
Introduction to html (912 kb)
PPTX
HTML Introduction
PPSX
Computer language - HTML tags
DOCX
Html example
PPT
web designing Lecture 1 (Fundamentals of web )
PPTX
Html lesson1 5
PPT
Html ppt computer
PDF
Html notes
PDF
htmlnotes Which tells about all the basic
PDF
htmlnotes-180924151434.pdf dafdkzndsvkdvdd
PDF
HTML Presentation
PPTX
Html (hypertext markup language)
PDF
Html beginner
PPTX
PPT
Html ppt by Fathima faculty Hasanath college for women bangalore
PPTX
YL basic tag
PDF
html.pdf
PDF
web technology practical file
PDF
Html beginners tutorial
Introduction to html (912 kb)
HTML Introduction
Computer language - HTML tags
Html example
web designing Lecture 1 (Fundamentals of web )
Html lesson1 5
Html ppt computer
Html notes
htmlnotes Which tells about all the basic
htmlnotes-180924151434.pdf dafdkzndsvkdvdd
HTML Presentation
Html (hypertext markup language)
Html beginner
Html ppt by Fathima faculty Hasanath college for women bangalore
YL basic tag
html.pdf
web technology practical file
Html beginners tutorial
Ad

More from H K (20)

PDF
Assignment4
 
DOCX
Assignment3
 
PDF
Induction
 
PDF
Solution3
 
PDF
Solution2
 
DOCX
Mid-
 
PDF
Assignment4
 
PDF
Assignment4
 
PDF
Dm assignment3
 
PPT
Proof
 
PDF
Resolution
 
DOCX
Assignment description
 
PDF
Dm assignment2
 
PDF
Set
 
PDF
Dm assignment1
 
PPTX
Logic
 
DOCX
Introduction
 
PDF
Assignment 2 sol
 
PDF
Assignment sw solution
 
PDF
Violinphoenix
 
Assignment4
 
Assignment3
 
Induction
 
Solution3
 
Solution2
 
Mid-
 
Assignment4
 
Assignment4
 
Dm assignment3
 
Proof
 
Resolution
 
Assignment description
 
Dm assignment2
 
Set
 
Dm assignment1
 
Logic
 
Introduction
 
Assignment 2 sol
 
Assignment sw solution
 
Violinphoenix
 

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
A Presentation on Artificial Intelligence
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Machine Learning_overview_presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
NewMind AI Weekly Chronicles - August'25-Week II
A comparative analysis of optical character recognition models for extracting...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
The Rise and Fall of 3GPP – Time for a Sabbatical?
A Presentation on Artificial Intelligence
MIND Revenue Release Quarter 2 2025 Press Release
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Machine Learning_overview_presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding

Html basics 1

  • 1. Lecture 2 What we will Learn • Heading tag: <h1>, <h2>, <h3>, <h4>, <h5>, <h6> • <br> tag • Comment Tag: <!-- -- > In the last lecture, we learned that the first tag on the web page we made is the HTML tag which tells the browser that the document is HTML; <html> The last tag on the page is the end HTML tag, which tells the browser that the HTML bit has finished; </html> Did you notice the '/' bit which tells the browser that this is the end tag, not the start? Heading Today we will learn about heading tag, which looks like <h1> or <h2> or <h3> or <h4> or <h5> or <h6>. Let us take an example to understand this tag. <html> <head> <title >My Home Page with a heading</title> </head> <body> <h1>My Heading</h1> You write things here... </body> </html> Write the code above and save as an .html file. And the output looks something like this My Heading You write things here…. Take another example <html> <head> <title >My Home Page with a heading</title> </head> <body> <h1>Heading 1</h1>
  • 2. <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> <p>This is normal text!</p> </body> </html> And the output is now, Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 This is normal text! So, that was different ways of representing text. Let us study about <br> tag. Please write the code below and save as an .html file <html> <head> <title >My Home Page with a heading</title> </head> <body> My name is Harshit. I am studying at University of Suwon . </body> </html> The output will be My name is Harshit I am studying at University of Suwon Q) Can any one tell me what is the problem with the above output? A) When I wrote the code, I made two lines, one line contains my name and the other line contains the name of University. But the output shows two lines one after the other. So that means, HTML does not interpret the <return> key.
  • 3. The solution to the above problem is <br> take. <br> tag is also called as blank rule. It inserts a line. <html> <head> <title >My Home Page with a heading</title> </head> <body> My name is Harshit. <br> I am studying at University of Suwon . </body> </html> Now the output will be My name is Harshit. I am studying at University of Suwon. Q What is the output for the code below? <html> <head> <title >My Home Page with a heading</title> </head> <body> My name is Harshit. <br> I am studying at University of Suwon. </body> </html> Answer) Comments Q) Why do we need comments?, infact every language supports comments, be it C, C++ or Java? Answer) When we write a page with a lot of code, and we come back to it later to wonder what we did, it can be made easier if we have comments in the document which don't show up in the browser. For example <html> <head> <!-- This is the title of my page
  • 4. <title>My Page</title> </head> <body> <!--This is the start of my page! As if I didn't know that - I did say it was a trivial example!--> <!--Start of my heading--> <h1>My Heading - What my page is about.</h1> <!--End of my heading--> </body> So the output is My Heading - What my page is about. Everthing contained in <!-- -- > is not visible on the browser.