SlideShare a Scribd company logo
1 of 27
INTRODUCTION TO HTML
Outlines: 
• What is HTML 
• Purpose of HTML Language 
• Structure of HTML Document 
• HTML Editors 
• HTML Tags 
• Attributes 
• HTML Comments
Objectives: 
• Understand the HTML Language 
• Create a simple web page 
• Understand the components of web page
WHAT IS HTML 
• HTML stands for Hyper Text Markup Language 
• HTML is a language for creating web pages. 
• HTML is not a programming language. 
• it is a markup language 
• A markup language is a set of markup tags 
• The markup tags describe how text should be 
displayed
Purpose of HTML 
Purpose of HTML Language is to create static web sites.
Structure of HTML Document 
1. Header section 
 <head></head> 
 Contains info about web page 
2. Body section 
 <body></body> 
 Contains main content of web page 
3. Footer section 
 <footer></footer> 
 Contains footer content of web page
7 
HTML Page Structure 
 That's all you need for a basic web page! 
<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
<title>My Title</title> 
</head> 
<body> 
<p>This is my first web page.</p> 
</body> 
<footer> 
<p>This is footer section of page.</p> 
</footer> 
</html>
HTML Text Editor 
HTML text editor is used to write HTML 
code and save that HTML file. 
There are different editors are available to 
write HTML code
Recommended Text Editors 
(Windows) 
• Notepad 
• Notepad++ 
• Macromedia Dream Wear 
• GNU Emacs 
• Crimson Editor 
• ConTEXT 
• SciTE 
• Komodo Edit 
• jEdit 
09.16.09
Notepad++ Editor
jEdit Editor
HTML Tags 
• HTML is comprised of “elements” and “tags” 
• HTML tags are keywords surrounded by angle brackets like 
<html> 
• HTML tags normally come in pairs like <p> and </p> 
• Tags are nested one inside another: 
Example: <body> <p> </p> <h1> </h1> </body> 
• The first tag in a pair is the start tag, the second tag is the 
end tag 
Note: The start and end tags are also called the opening and 
closing tags.
First HTML Page: Tags 
<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
<title>My First HTML Page</title> 
</head> 
<body> 
<p>This is some text...</p> 
</body> 
</html> 
13 
Opening tag 
Closing tag
 HTML Tag: 
HTML – Required Tags 
 <html> … </html> (Required!) 
14 
 Basic tag to identify portion of file that contains HTML 
 <html> is an opening tag 
 </html> is a closing tag (note the direction of the slash!) 
 text between the opening and closing tag is called the “element” 
 Head Tag: 
 <head> … </head> (Required!) 
 placed at the top of document immediately after the <html> tag 
 tags information about the document, e.g. author, style, etc. 
 contains the required document <title>...</title> tag
HTML – Required Tags 
• Meta Tag: 
• <meta> 
– is used to specify keywords that describe a document’s 
contents as well as a short description. 
• Two necessary attributes – "name" & "content" 
<meta name="keywords" content="baseball, soccer, 
tennis"/> 
<meta name="description" content="Sports information 
page"/>
16 
HTML – Required Tags 
 Title Tag: 
 <title> … </title> (Required!) 
 included as an element inside the <head>…</head> section 
 element of this tag is the title displayed in title bar of the browser 
 may also be used as title of page when page is bookmarked 
 should be meaningful and uniquely identify the page 
 Body Tag: 
 <body> … </body> (Required!) 
 included as the second element inside the <html>…</html> tags. 
 follows the <head>…</head> portion of the document 
 contains the information to be displayed in the browser window 
 any attributes set on this tag will apply to the entire page
17 
HTML – Required Tags 
 Paragraph tag: 
 <p> … </p> (Required!) 
 included as an element inside the <body>…</body> section 
 Surrounds a paragraph of text 
 Document Type Tag: 
 DOCTYPE (Required!) 
 Must be the very first line of your file, before <html> 
 NOT an HTML tag; it is an instruction to your web browser 
 Tells the browser what version of HTML to expect 
 In this course we use only the “strict” HTML version 4.01 type: 
<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
18 
HTML - Basic Tags 
• More useful basic tags: 
 Line Break tag: 
 <br> (no closing tag needed) 
 put a line break in the text (starts a new line) 
 <p>this is paragraph</p><br> 
 <p>this is paragraph</p> 
 Heading Tag: 
 <h1> … </h1> through <h6> ... </h6> 
 used to identify text as a Level 1 (major) to Level 6 (minor) heading 
 Code: Output: 
<h1>This is first heading</h1> This is first heading 
<h2>This is first heading</h2> This is first heading 
<h3>This is first heading</h3> This is first heading 
<h4>This is first heading</h4> This is first heading 
<h5>This is first heading</h5> This is first heading 
<h6>This is first heading</h6> This is first heading
19 
HTML - Basic Tags 
• The Anchor Tag OR Hyper Linking Tag 
 <a> … </a> 
 one major attribute – the location of the hyperlink: 
 href=”string” 
 element is clickable/selectable as a document hyperlink 
 browser attempts to load the page specified by the href= 
attribute 
 the href= string can be a relative URL on the same server: 
 without the leading http://host/ it is in the same directory structure: 
 e.g. <a href=“page2.html”>Click here to continue</a> 
 e.g. <a href=”images/box.jpg”>See the box here.</a> 
 e.g. <a href=“../another_dir/page3.html”>Click here</a>
20 
HTML - Basic Tags 
 Anchor Tag: 
<a>…</a> anchor tag continued 
 The href= string can be an absolute URL on any server: 
 string can be any HTTP URL (web address) you like: 
 e.g. <a href=“http://www.gnu.org/philosophy/”>Free Software</a> 
 E.g <a href=“http://google.com” target=“_blank”>Google</a> 
 The href= string can be an email address: 
 string can be an email address preceded by “mailto:” 
 e.g. <a href=”mailto:idallen@idallen.ca>Ian! D. Allen email</a> 
 Attempts to open an email client (specified in the web browser's 
options) and places the specified email address in the To: field of a new 
email message.
Anchor Tag Syntax 
<html> 
<head> 
<title>Anchor Tag</title> 
</head> 
<body> 
<a href=“iba-suk.edu.pk” target=“_blank”>IBA 
Sukkur</a> 
</body> 
</html>
22 
HTML - Basic Tags 
 Image Tag: 
 <img> (no closing tag needed) 
 used to display graphics (.jpeg, .png, .gif) in your web pages 
 you must specify the URL for the image source, and an alt= text 
 the basic attributes of <img> are: 
 src=”string” - the absolute or relative location of the image file 
 alt=”string” - Alternate Text for people who don't see images 
 height=”string” - image height, percent or absolute pixels (optional) 
 width=”string” - image width, percent or absolute pixels (optional) 
 title=”string” - mouse-over title of the image (optional) 
 E.g. <img src=“d:/images/iba.gif” width=“500” height=“600”>
Syntax 
<img src=“d:/pictures/desert.jpeg”>
24 
HTML - Basic Tags 
• Horizontal Line Tag: 
• <hr> (no closing tag needed) 
– Hard/Horizontal Rule – draw a horizontal line 
– rule appearance can be changed with styles 
• Quotation Tag: 
<blockquote> … </blockquote> 
– block quotation, indented 
• PRE Tag: 
• <pre> … </pre> 
– preformatted text (e.g. computer code or output) 
– fixed-width font (e.g. Courier fixed width) 
– preserves spaces and line breaks
ATTRIBUTES 
An attribute is a special code that can enhance or modify a tag. 
They are generally located in the starting tag after the tag 
name. 
Attribute Name 
Syntax: 
<p style=“color: red; font-size:18px”>This is a 
paragraph </p> 
Attribute Value
HTML COMMENTS 
Comment Tag: 
 <!-- comments here --> 
Comments are enclosed in <!-- and --> 
Example 
<!--This comment will not be displayed--> 
<p>This is a regular paragraph</p>
27 
ComDepscrlibee HtTeML VHersTionML Program 
<!DOCTYPE HTML PUBLIC 
"-//W3C//DTD HTML 4.01//EN" 
Describe HTML Page Type to the browser 
"http://www.Define w3.keywords 
org/TR/html4/strict.dtd"> <html> 
<html> 
Define info about web page 
<meta name="keywords" content="baseball, soccer, tennis"/> 
Define Title of Web Page 
<head> 
<title> Starts Home the body Page secton </title> 
of page 
</head> 
Define ParagrapDhefine Attribute Name 
<body> 
Define Comment 
<p style=“color: red; font-size:18px”>This is a paragraph. 1</p> 
Define Image 
<p>This is a paragraph. 2</p> <!----This is a comment text ---> 
Define Heading 
<img src=“d:/pictures/desert.jpeg” width=“500” height=“600”> 
<h1>This is heading</h1> 
</body> 
</html>

More Related Content

What's hot

Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
vikasgaur31
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTML
Aarti P
 

What's hot (20)

Html presentation
Html presentationHtml presentation
Html presentation
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
HTML/HTML5
HTML/HTML5HTML/HTML5
HTML/HTML5
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
CSS
CSSCSS
CSS
 
Html
HtmlHtml
Html
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html basics
Html basicsHtml basics
Html basics
 
html-css
html-csshtml-css
html-css
 
Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easily
 
Html links
Html linksHtml links
Html links
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Learning Html
Learning HtmlLearning Html
Learning Html
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTML
 

Viewers also liked (7)

Lesson 1: Introduction to HTML
Lesson 1: Introduction to HTMLLesson 1: Introduction to HTML
Lesson 1: Introduction to HTML
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Internet programming lecture 1
Internet programming lecture 1Internet programming lecture 1
Internet programming lecture 1
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 

Similar to Lecture 2 introduction to html

Ankit (221348051) BCA-Aiml.pptx
Ankit (221348051) BCA-Aiml.pptxAnkit (221348051) BCA-Aiml.pptx
Ankit (221348051) BCA-Aiml.pptx
HKShab
 
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxHTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
TEJASARGADE5
 

Similar to Lecture 2 introduction to html (20)

Html tutorial
Html tutorialHtml tutorial
Html tutorial
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
SEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.in
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
Ankit (221348051) BCA-Aiml.pptx
Ankit (221348051) BCA-Aiml.pptxAnkit (221348051) BCA-Aiml.pptx
Ankit (221348051) BCA-Aiml.pptx
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
 
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxHTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
 
Html
HtmlHtml
Html
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02
 
html
htmlhtml
html
 
An-Introduction-to-HTML
An-Introduction-to-HTMLAn-Introduction-to-HTML
An-Introduction-to-HTML
 
Html
HtmlHtml
Html
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 
Html basics
Html basicsHtml basics
Html basics
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 

Lecture 2 introduction to html

  • 2. Outlines: • What is HTML • Purpose of HTML Language • Structure of HTML Document • HTML Editors • HTML Tags • Attributes • HTML Comments
  • 3. Objectives: • Understand the HTML Language • Create a simple web page • Understand the components of web page
  • 4. WHAT IS HTML • HTML stands for Hyper Text Markup Language • HTML is a language for creating web pages. • HTML is not a programming language. • it is a markup language • A markup language is a set of markup tags • The markup tags describe how text should be displayed
  • 5. Purpose of HTML Purpose of HTML Language is to create static web sites.
  • 6. Structure of HTML Document 1. Header section  <head></head>  Contains info about web page 2. Body section  <body></body>  Contains main content of web page 3. Footer section  <footer></footer>  Contains footer content of web page
  • 7. 7 HTML Page Structure  That's all you need for a basic web page! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>My Title</title> </head> <body> <p>This is my first web page.</p> </body> <footer> <p>This is footer section of page.</p> </footer> </html>
  • 8. HTML Text Editor HTML text editor is used to write HTML code and save that HTML file. There are different editors are available to write HTML code
  • 9. Recommended Text Editors (Windows) • Notepad • Notepad++ • Macromedia Dream Wear • GNU Emacs • Crimson Editor • ConTEXT • SciTE • Komodo Edit • jEdit 09.16.09
  • 12. HTML Tags • HTML is comprised of “elements” and “tags” • HTML tags are keywords surrounded by angle brackets like <html> • HTML tags normally come in pairs like <p> and </p> • Tags are nested one inside another: Example: <body> <p> </p> <h1> </h1> </body> • The first tag in a pair is the start tag, the second tag is the end tag Note: The start and end tags are also called the opening and closing tags.
  • 13. First HTML Page: Tags <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> 13 Opening tag Closing tag
  • 14.  HTML Tag: HTML – Required Tags  <html> … </html> (Required!) 14  Basic tag to identify portion of file that contains HTML  <html> is an opening tag  </html> is a closing tag (note the direction of the slash!)  text between the opening and closing tag is called the “element”  Head Tag:  <head> … </head> (Required!)  placed at the top of document immediately after the <html> tag  tags information about the document, e.g. author, style, etc.  contains the required document <title>...</title> tag
  • 15. HTML – Required Tags • Meta Tag: • <meta> – is used to specify keywords that describe a document’s contents as well as a short description. • Two necessary attributes – "name" & "content" <meta name="keywords" content="baseball, soccer, tennis"/> <meta name="description" content="Sports information page"/>
  • 16. 16 HTML – Required Tags  Title Tag:  <title> … </title> (Required!)  included as an element inside the <head>…</head> section  element of this tag is the title displayed in title bar of the browser  may also be used as title of page when page is bookmarked  should be meaningful and uniquely identify the page  Body Tag:  <body> … </body> (Required!)  included as the second element inside the <html>…</html> tags.  follows the <head>…</head> portion of the document  contains the information to be displayed in the browser window  any attributes set on this tag will apply to the entire page
  • 17. 17 HTML – Required Tags  Paragraph tag:  <p> … </p> (Required!)  included as an element inside the <body>…</body> section  Surrounds a paragraph of text  Document Type Tag:  DOCTYPE (Required!)  Must be the very first line of your file, before <html>  NOT an HTML tag; it is an instruction to your web browser  Tells the browser what version of HTML to expect  In this course we use only the “strict” HTML version 4.01 type: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • 18. 18 HTML - Basic Tags • More useful basic tags:  Line Break tag:  <br> (no closing tag needed)  put a line break in the text (starts a new line)  <p>this is paragraph</p><br>  <p>this is paragraph</p>  Heading Tag:  <h1> … </h1> through <h6> ... </h6>  used to identify text as a Level 1 (major) to Level 6 (minor) heading  Code: Output: <h1>This is first heading</h1> This is first heading <h2>This is first heading</h2> This is first heading <h3>This is first heading</h3> This is first heading <h4>This is first heading</h4> This is first heading <h5>This is first heading</h5> This is first heading <h6>This is first heading</h6> This is first heading
  • 19. 19 HTML - Basic Tags • The Anchor Tag OR Hyper Linking Tag  <a> … </a>  one major attribute – the location of the hyperlink:  href=”string”  element is clickable/selectable as a document hyperlink  browser attempts to load the page specified by the href= attribute  the href= string can be a relative URL on the same server:  without the leading http://host/ it is in the same directory structure:  e.g. <a href=“page2.html”>Click here to continue</a>  e.g. <a href=”images/box.jpg”>See the box here.</a>  e.g. <a href=“../another_dir/page3.html”>Click here</a>
  • 20. 20 HTML - Basic Tags  Anchor Tag: <a>…</a> anchor tag continued  The href= string can be an absolute URL on any server:  string can be any HTTP URL (web address) you like:  e.g. <a href=“http://www.gnu.org/philosophy/”>Free Software</a>  E.g <a href=“http://google.com” target=“_blank”>Google</a>  The href= string can be an email address:  string can be an email address preceded by “mailto:”  e.g. <a href=”mailto:idallen@idallen.ca>Ian! D. Allen email</a>  Attempts to open an email client (specified in the web browser's options) and places the specified email address in the To: field of a new email message.
  • 21. Anchor Tag Syntax <html> <head> <title>Anchor Tag</title> </head> <body> <a href=“iba-suk.edu.pk” target=“_blank”>IBA Sukkur</a> </body> </html>
  • 22. 22 HTML - Basic Tags  Image Tag:  <img> (no closing tag needed)  used to display graphics (.jpeg, .png, .gif) in your web pages  you must specify the URL for the image source, and an alt= text  the basic attributes of <img> are:  src=”string” - the absolute or relative location of the image file  alt=”string” - Alternate Text for people who don't see images  height=”string” - image height, percent or absolute pixels (optional)  width=”string” - image width, percent or absolute pixels (optional)  title=”string” - mouse-over title of the image (optional)  E.g. <img src=“d:/images/iba.gif” width=“500” height=“600”>
  • 24. 24 HTML - Basic Tags • Horizontal Line Tag: • <hr> (no closing tag needed) – Hard/Horizontal Rule – draw a horizontal line – rule appearance can be changed with styles • Quotation Tag: <blockquote> … </blockquote> – block quotation, indented • PRE Tag: • <pre> … </pre> – preformatted text (e.g. computer code or output) – fixed-width font (e.g. Courier fixed width) – preserves spaces and line breaks
  • 25. ATTRIBUTES An attribute is a special code that can enhance or modify a tag. They are generally located in the starting tag after the tag name. Attribute Name Syntax: <p style=“color: red; font-size:18px”>This is a paragraph </p> Attribute Value
  • 26. HTML COMMENTS Comment Tag:  <!-- comments here --> Comments are enclosed in <!-- and --> Example <!--This comment will not be displayed--> <p>This is a regular paragraph</p>
  • 27. 27 ComDepscrlibee HtTeML VHersTionML Program <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" Describe HTML Page Type to the browser "http://www.Define w3.keywords org/TR/html4/strict.dtd"> <html> <html> Define info about web page <meta name="keywords" content="baseball, soccer, tennis"/> Define Title of Web Page <head> <title> Starts Home the body Page secton </title> of page </head> Define ParagrapDhefine Attribute Name <body> Define Comment <p style=“color: red; font-size:18px”>This is a paragraph. 1</p> Define Image <p>This is a paragraph. 2</p> <!----This is a comment text ---> Define Heading <img src=“d:/pictures/desert.jpeg” width=“500” height=“600”> <h1>This is heading</h1> </body> </html>