SlideShare uma empresa Scribd logo
1 de 39
INTRODUCTION TO HTML
BY :AHSAN RAHIM
A COMPLETE
HTML BASICS
Text, Images,Tables, Forms
HTML: HYPERTEXT MARKUP LANGUAGE
• HTML documents are simply text documents with a specific
form
• Documents comprised of content and markup tags
• Content: actual information being conveyed
• The markup tags tell the Web browser how to display the
page
• An HTML file must have an htm or html file extension
• An HTML file can be created using a simple text editor
HTML STRUCTURE
• HTML is comprised of “elements” / “tags”
• Begins with <html> and ends with </html>
• Elements (tags) are nested one inside another:
• Tags have attributes:
• HTML describes structure using two main sections: <head>
and <body>
<html> <head></head> <body></body> </html>
<img src="logo.jpg" alt="logo" />
FIRST HTML PAGE
• test.html
<!DOCTYPE HTML>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<p>This is some text...</p>
</body>
</html>
FIRST HTML PAGE: TAGS
• An HTML element consists of an opening tag, a closing tag and the content inside
<!DOCTYPE HTML>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<p>This is some text...</p>
</body>
</html>
Opening tag
Closing tag
FIRST HTML PAGE: HEADER
<!DOCTYPE HTML>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<p>This is some text...</p>
</body>
</html>
HTML Header
FIRST HTML PAGE: BODY
<!DOCTYPE HTML>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<p>This is some text...</p>
</body>
</html>
HTML Body
SOME SIMPLE TAGS
• Hyperlink Tags
• Image Tags
• Text formatting tags
<a href="http://ahsanrahim.freeweb.pk/"
title=“Ahsan Rahim">Link to Ahsan’s Web site</a>
<img src="logo.gif" alt="logo" />
This text is <em>emphasized.</em>
<br />new line<br />
This one is <strong>more emphasized.</strong>
SOME SIMPLE TAGS – EXAMPLE (2)
• Some-tags.html
<!DOCTYPE HTML>
<html>
<head>
<title>Simple Tags Demo</title>
</head>
<body>
<a href="http://ahsanrahim.freeweb.pk/" title=
“Ahsan Rahim">This is a link.</a>
<br />
<img src="logo.gif" alt="logo" />
<br />
<strong>Bold</strong> and <em>italic</em> text.
</body>
</html>
TAGS ATTRIBUTES
• Tags can have attributes
• Attributes specify properties and behavior
• Example:
• Few attributes can apply to every element:
• id, style, class, title
• The id is unique in the document
• Content of title attribute is displayed as hint when the element
is hovered with the mouse
<img src="logo.gif" alt="logo" />
Attribute alt with value "logo"
HEADINGS AND PARAGRAPHS
• Heading Tags (h1 – h6)
• Paragraph Tags
• Sections: div and span
<p>This is my first paragraph</p>
<p>This is my second paragraph</p>
<h1>Heading 1</h1>
<h2>Sub heading 2</h2>
<h3>Sub heading 3</h3>
<div style="background: skyblue;">
This is a div</div>
HEADINGS AND PARAGRAPHS –
EXAMPLE
• headings.html
<!DOCTYPE HTML>
<html>
<head><title>Headings and paragraphs</title></head>
<body>
<h1>Heading 1</h1>
<h2>Sub heading 2</h2>
<h3>Sub heading 3</h3>
<p>This is my first paragraph</p>
<p>This is my second paragraph</p>
<div style="background:skyblue">
This is a div</div>
</body>
</html>
HEADINGS AND PARAGRAPHS –
EXAMPLE (2)
• headings.html
<!DOCTYPE HTML>
<html>
<head><title>Headings and paragraphs</title></head>
<body>
<h1>Heading 1</h1>
<h2>Sub heading 2</h2>
<h3>Sub heading 3</h3>
<p>This is my first paragraph</p>
<p>This is my second paragraph</p>
<div style="background:skyblue">
This is a div</div>
</body>
</html>
INTRODUCTION TO HTML
HTML Document Structure in Depth
PREFACE
• It is important to have the correct vision and attitude towards
HTML
• HTML is only about structure, not appearance
• Browsers tolerate invalid HTML code and parse errors – you
should not
THE <!DOCTYPE> DECLARATION
• HTML documents must start with a document type definition (DTD)
• It tells web browsers what type is the served code
• Possible versions: HTML 4.01, XHTML 1.0 (Transitional or Strict),
XHTML 1.1, HTML 5
• Example:
• See http://w3.org/QA/2002/04/valid-dtd-list.html for a list of
possible doctypes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
THE <head> SECTION
• Contains information that doesn’t show directly on the viewable
page
• Starts after the <!doctype> declaration
• Begins with <head> and ends with </head>
• Contains mandatory single <title> tag
• Can contain some other tags, e.g.
• <meta>
• <script>
• <style>
• <!–- comments -->
<head> SECTION: <title> TAG
• Title should be placed between <head> and </head> tags
• Used to specify a title in the window title bar
• Search engines and people rely on titles
<title>Ahsan Rahim – UX/UI - </title>
<head> SECTION: <meta>
• Meta tags additionally describe the content contained within the
page
<meta name="description" content="HTML tutorial" />
<meta name="keywords" content="html, web design, styles" />
<meta name="author" content="Chris Brewer" />
<meta http-equiv="refresh" content="5;
url=http://ahsanrahim.freeweb.pk" />
<head> SECTION: < script >
• The <script> element is used to embed scripts into an HTML
document
• Script are executed in the client's Web browser
• Scripts can live in the <head> and in the <body> sections
• Supported client-side scripting languages:
• JavaScript (it is not Java!)
• VBScript
• JScript
THE <script> TAG – EXAMPLE
• scripts-example.html<!DOCTYPE HTML>
<html>
<head>
<title>JavaScript Example</title>
<script type="text/javascript">
function sayHello() {
document.write("<p>Hello World!</p>");
}
</script>
</head>
<body>
<script type=
"text/javascript">
sayHello();
</script>
</body>
</html>
<head> SECTION: <style>
• The <style> element embeds formatting information (CSS styles) into an
HTML page
<html>
<head>
<style type="text/css">
p { font-size: 12pt; line-height: 12pt; }
p:first-letter { font-size: 200%; }
span { text-transform: uppercase; }
</style>
</head>
<body>
<p>Styles demo.<br />
<span>Test uppercase</span>.
</p>
</body>
</html>
style-example.html
COMMENTS: <!-- --> TAG
• Comments can exist anywhere between the <html></html> tags
• Comments start with <!-- and end with -->
<!–- Telerik Logo (a JPG file) -->
<img src="logo.jpg" alt=“Telerik Logo">
<!–- Hyperlink to the web site -->
<a href="http://telerik.com/">Telerik</a>
<!–- Show the news table -->
<table class="newstable">
...
<body> SECTION: INTRODUCTION
• The <body> section describes the viewable portion of the page
• Starts after the <head> </head> section
• Begins with <body> and ends with </body>
<html>
<head><title>Test page</title></head>
<body>
<!-- This is the Web page body -->
</body>
</html>
TEXT FORMATTING
• Text formatting tags modify the text between the opening tag and the
closing tag
• Ex. <b>Hello</b> makes “Hello” bold
TEXT FORMATTING – EXAMPLE
• text-formatting.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Notice</h1>
<p>This is a <em>sample</em> Web page.</p>
<p><pre>Next paragraph:
preformatted.</pre></p>
<h2>More Info</h2>
<p>Specifically, we’re using XHMTL 1.0 transitional.<br />
Next line.</p>
</body>
</html>
TEXT FORMATTING – EXAMPLE (2)
• text-formatting.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Notice</h1>
<p>This is a <em>sample</em> Web page.</p>
<p><pre>Next paragraph:
preformatted.</pre></p>
<h2>More Info</h2>
<p>Specifically, we’re using XHMTL 1.0 transitional.<br />
Next line.</p>
</body>
</html>
HYPERLINKS: <a> TAG
• Link to a document called form.html on the same server in the same
directory:
• Link to a document called parent.html on the same server in the parent
directory:
• Link to a document called cat.html on the same server in the
subdirectory stuff:
<a href="form.html">Fill Our Form</a>
<a href="../parent.html">Parent</a>
<a href="stuff/cat.html">Catalog</a>
HYPERLINKS: <a> TAG (2)
• Link to an external Web site:
• Always use a full URL, including "http://", not just "www.somesite.com"
• Using the target="_blank" attribute opens the link in a new window
• Link to an e-mail address:
<a href="http://www.example.com" target="_blank">Example</a>
<a href="mailto:bugs@example.com?subject=Bug+Report">
Please report bugs here (by e-mail only)</a>
HYPERLINKS: <a> TAG (3)
• Link to a document called apply-now.html
• On the same server, in same directory
• Using an image as a link button:
• Link to a document called index.html
• On the same server, in the subdirectory english of the parent directory:
<a href="apply-now.html"><img
src="apply-now-button.jpg" /></a>
<a href="../english/index.html">Switch to English
version</a>
HYPERLINKS AND SECTIONS
• Link to another location in the same document:
• Link to a specific location in another document:
<a href="#section1">Go to Introduction</a>
...
<h2 id="section1">Introduction</h2>
<a href="chapter3.html#section3.1.1">Go to Section 3.1.1</a>
<!–- In chapter3.html -->
...
<div id="section3.1.1">
<h3>3.1.1. Technical Background</h3>
</div>
HYPERLINKS – EXAMPLE
• hyperlinks.html
<a href="form.html">Fill Our Form</a> <br />
<a href="../parent.html">Parent</a> <br />
<a href="stuff/cat.html">Catalog</a> <br />
<a href="http://ahsanrahim.freeweb.pk" target="_blank">BASD</a> <br />
<a href="mailto:bugs@example.com?subject=Bug Report">Please report bugs
here (by e-mail only)</a>
<br />
<a href="apply-now.html"><img src="apply-now-button.jpg” /></a> <br />
<a href="../english/index.html">Switch to English version</a> <br />
HYPERLINKS – EXAMPLE (2)
• hyperlinks.html
<a href="form.html">Fill Our Form</a> <br />
<a href="../parent.html">Parent</a> <br />
<a href="stuff/cat.html">Catalog</a> <br />
<a href="http://ahsanrahim.freeweb.pk" target="_blank">BASD</a> <br />
<a href="mailto:bugs@example.com?subject=Bug Report">Please report bugs
here (by e-mail only)</a>
<br />
<a href="apply-now.html"><img src="apply-now-button.jpg” /></a> <br />
<a href="../english/index.html">Switch to English version</a> <br />
LINKS TO THE SAME DOCUMENT –
EXAMPLE (2)
• links-to-same-document.html
<h1>Table of Contents</h1>
<p><a href="#section1">Introduction</a><br />
<a href="#section2">Some background</A><br />
<a href="#section2.1">Project History</a><br />
...the rest of the table of contents...
<!-- The document text follows here -->
<h2 id="section1">Introduction</h2>
... Section 1 follows here ...
<h2 id="section2">Some background</h2>
... Section 2 follows here ...
<h3 id="section2.1">Project History</h3>
... Section 2.1 follows here ...
IMAGES: <img> TAG
• Inserting an image with <img> tag:
• Image attributes:
• Example:
<img src="/img/basd-logo.png">
<img src="./php.png" alt="PHP Logo" />
MISCELLANEOUS TAGS
• <hr />: Draws a horizontal rule (line):
• <center></center>: Deprecated!
• <font></font>: Deprecated!
<hr size="5" width="70%" />
<center>Hello World!</center>
<font size="3" color="blue">Font3</font>
<font size="+4" color="blue">Font+4</font>
MISCELLANEOUS TAGS – EXAMPLE
• misc.html
<html>
<head>
<title>Miscellaneous Tags Example</title>
</head>
<body>
<hr size="5" width="70%" />
<center>Hello World!</center>
<font size="3" color="blue">Font3</font>
<font size="+4" color="blue">Font+4</font>
</body>
</html>
THANKS
BY :AHSAN RAHIM
INTRODUCTIONTO HTML

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 
CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
 
Css Text Formatting
Css Text FormattingCss Text Formatting
Css Text Formatting
 
CSS
CSSCSS
CSS
 
CSS - Text Properties
CSS - Text PropertiesCSS - Text Properties
CSS - Text Properties
 
HTML Lesson 1
HTML Lesson 1HTML Lesson 1
HTML Lesson 1
 
HTML and CSS crash course!
HTML and CSS crash course!HTML and CSS crash course!
HTML and CSS crash course!
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
Basic Html Knowledge for students
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for students
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html Basics
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
HTML
HTMLHTML
HTML
 
Div tag presentation
Div tag presentationDiv tag presentation
Div tag presentation
 
Html
HtmlHtml
Html
 
Hyperlinks in HTML
Hyperlinks in HTMLHyperlinks in HTML
Hyperlinks in HTML
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
HTML5: features with examples
HTML5: features with examplesHTML5: features with examples
HTML5: features with examples
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 

Semelhante a What is HTML - An Introduction to HTML (Hypertext Markup Language)

If you know nothing about HTML, this is where you can start !!
If you know nothing about HTML, this is where you can start !!If you know nothing about HTML, this is where you can start !!
If you know nothing about HTML, this is where you can start !!Dr Sukhpal Singh Gill
 
3 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp023 1-html-fundamentals-110302100520-phpapp02
3 1-html-fundamentals-110302100520-phpapp02Aditya Varma
 
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 needDipen Parmar
 
02 HTML-01.pdf
02 HTML-01.pdf02 HTML-01.pdf
02 HTML-01.pdfEshaYasir1
 
HyperText Markup Language - HTML
HyperText Markup Language - HTMLHyperText Markup Language - HTML
HyperText Markup Language - HTMLSun Technlogies
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsMinea Chem
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsNikita Garg
 
4. html css-java script-basics
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basicsxu fag
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsSun Technlogies
 
SEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSky Infotech
 

Semelhante a What is HTML - An Introduction to HTML (Hypertext Markup Language) (20)

If you know nothing about HTML, this is where you can start !!
If you know nothing about HTML, this is where you can start !!If you know nothing about HTML, this is where you can start !!
If you know nothing about HTML, this is where you can start !!
 
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
 
Html2
Html2Html2
Html2
 
HTML guide for beginners
HTML guide for beginnersHTML guide for beginners
HTML guide for beginners
 
Java script and html new
Java script and html newJava script and html new
Java script and html new
 
Java script and html
Java script and htmlJava script and html
Java script and 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
 
02 HTML-01.pdf
02 HTML-01.pdf02 HTML-01.pdf
02 HTML-01.pdf
 
Html Workshop
Html WorkshopHtml Workshop
Html Workshop
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
HyperText Markup Language - HTML
HyperText Markup Language - HTMLHyperText Markup Language - HTML
HyperText Markup Language - 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, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
Html
HtmlHtml
Html
 
SEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.inSEO Training in Noida- Skyinfotech.in
SEO Training in Noida- Skyinfotech.in
 

Mais de Ahsan Rahim

What is Wireless Communication or Unguided Transmission Media
What is Wireless Communication or Unguided Transmission MediaWhat is Wireless Communication or Unguided Transmission Media
What is Wireless Communication or Unguided Transmission MediaAhsan Rahim
 
Software Project Management | An Overview of the Software Project Management
Software Project Management | An Overview of the Software Project ManagementSoftware Project Management | An Overview of the Software Project Management
Software Project Management | An Overview of the Software Project ManagementAhsan Rahim
 
Basics of the Computer System
Basics of the Computer SystemBasics of the Computer System
Basics of the Computer SystemAhsan Rahim
 
What kinds of languages can agents use to communicate?
What kinds of languages can agents use to communicate?What kinds of languages can agents use to communicate?
What kinds of languages can agents use to communicate?Ahsan Rahim
 
Multiagent System Communication
Multiagent System Communication Multiagent System Communication
Multiagent System Communication Ahsan Rahim
 
Wireless communication or Unguided Transmission Media
Wireless communication or Unguided Transmission MediaWireless communication or Unguided Transmission Media
Wireless communication or Unguided Transmission MediaAhsan Rahim
 
Network Topologies
Network TopologiesNetwork Topologies
Network TopologiesAhsan Rahim
 
Processes description and process control.
Processes description and process control.Processes description and process control.
Processes description and process control.Ahsan Rahim
 
Agile Development | Agile Process Models
Agile Development | Agile Process ModelsAgile Development | Agile Process Models
Agile Development | Agile Process ModelsAhsan Rahim
 
Traditional Process Models
Traditional Process ModelsTraditional Process Models
Traditional Process ModelsAhsan Rahim
 

Mais de Ahsan Rahim (10)

What is Wireless Communication or Unguided Transmission Media
What is Wireless Communication or Unguided Transmission MediaWhat is Wireless Communication or Unguided Transmission Media
What is Wireless Communication or Unguided Transmission Media
 
Software Project Management | An Overview of the Software Project Management
Software Project Management | An Overview of the Software Project ManagementSoftware Project Management | An Overview of the Software Project Management
Software Project Management | An Overview of the Software Project Management
 
Basics of the Computer System
Basics of the Computer SystemBasics of the Computer System
Basics of the Computer System
 
What kinds of languages can agents use to communicate?
What kinds of languages can agents use to communicate?What kinds of languages can agents use to communicate?
What kinds of languages can agents use to communicate?
 
Multiagent System Communication
Multiagent System Communication Multiagent System Communication
Multiagent System Communication
 
Wireless communication or Unguided Transmission Media
Wireless communication or Unguided Transmission MediaWireless communication or Unguided Transmission Media
Wireless communication or Unguided Transmission Media
 
Network Topologies
Network TopologiesNetwork Topologies
Network Topologies
 
Processes description and process control.
Processes description and process control.Processes description and process control.
Processes description and process control.
 
Agile Development | Agile Process Models
Agile Development | Agile Process ModelsAgile Development | Agile Process Models
Agile Development | Agile Process Models
 
Traditional Process Models
Traditional Process ModelsTraditional Process Models
Traditional Process Models
 

Último

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 

Último (20)

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

What is HTML - An Introduction to HTML (Hypertext Markup Language)

  • 1. INTRODUCTION TO HTML BY :AHSAN RAHIM A COMPLETE
  • 3. HTML: HYPERTEXT MARKUP LANGUAGE • HTML documents are simply text documents with a specific form • Documents comprised of content and markup tags • Content: actual information being conveyed • The markup tags tell the Web browser how to display the page • An HTML file must have an htm or html file extension • An HTML file can be created using a simple text editor
  • 4. HTML STRUCTURE • HTML is comprised of “elements” / “tags” • Begins with <html> and ends with </html> • Elements (tags) are nested one inside another: • Tags have attributes: • HTML describes structure using two main sections: <head> and <body> <html> <head></head> <body></body> </html> <img src="logo.jpg" alt="logo" />
  • 5. FIRST HTML PAGE • test.html <!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html>
  • 6. FIRST HTML PAGE: TAGS • An HTML element consists of an opening tag, a closing tag and the content inside <!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> Opening tag Closing tag
  • 7. FIRST HTML PAGE: HEADER <!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> HTML Header
  • 8. FIRST HTML PAGE: BODY <!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> HTML Body
  • 9. SOME SIMPLE TAGS • Hyperlink Tags • Image Tags • Text formatting tags <a href="http://ahsanrahim.freeweb.pk/" title=“Ahsan Rahim">Link to Ahsan’s Web site</a> <img src="logo.gif" alt="logo" /> This text is <em>emphasized.</em> <br />new line<br /> This one is <strong>more emphasized.</strong>
  • 10. SOME SIMPLE TAGS – EXAMPLE (2) • Some-tags.html <!DOCTYPE HTML> <html> <head> <title>Simple Tags Demo</title> </head> <body> <a href="http://ahsanrahim.freeweb.pk/" title= “Ahsan Rahim">This is a link.</a> <br /> <img src="logo.gif" alt="logo" /> <br /> <strong>Bold</strong> and <em>italic</em> text. </body> </html>
  • 11. TAGS ATTRIBUTES • Tags can have attributes • Attributes specify properties and behavior • Example: • Few attributes can apply to every element: • id, style, class, title • The id is unique in the document • Content of title attribute is displayed as hint when the element is hovered with the mouse <img src="logo.gif" alt="logo" /> Attribute alt with value "logo"
  • 12. HEADINGS AND PARAGRAPHS • Heading Tags (h1 – h6) • Paragraph Tags • Sections: div and span <p>This is my first paragraph</p> <p>This is my second paragraph</p> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3> <div style="background: skyblue;"> This is a div</div>
  • 13. HEADINGS AND PARAGRAPHS – EXAMPLE • headings.html <!DOCTYPE HTML> <html> <head><title>Headings and paragraphs</title></head> <body> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3> <p>This is my first paragraph</p> <p>This is my second paragraph</p> <div style="background:skyblue"> This is a div</div> </body> </html>
  • 14. HEADINGS AND PARAGRAPHS – EXAMPLE (2) • headings.html <!DOCTYPE HTML> <html> <head><title>Headings and paragraphs</title></head> <body> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3> <p>This is my first paragraph</p> <p>This is my second paragraph</p> <div style="background:skyblue"> This is a div</div> </body> </html>
  • 15. INTRODUCTION TO HTML HTML Document Structure in Depth
  • 16. PREFACE • It is important to have the correct vision and attitude towards HTML • HTML is only about structure, not appearance • Browsers tolerate invalid HTML code and parse errors – you should not
  • 17. THE <!DOCTYPE> DECLARATION • HTML documents must start with a document type definition (DTD) • It tells web browsers what type is the served code • Possible versions: HTML 4.01, XHTML 1.0 (Transitional or Strict), XHTML 1.1, HTML 5 • Example: • See http://w3.org/QA/2002/04/valid-dtd-list.html for a list of possible doctypes <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • 18. THE <head> SECTION • Contains information that doesn’t show directly on the viewable page • Starts after the <!doctype> declaration • Begins with <head> and ends with </head> • Contains mandatory single <title> tag • Can contain some other tags, e.g. • <meta> • <script> • <style> • <!–- comments -->
  • 19. <head> SECTION: <title> TAG • Title should be placed between <head> and </head> tags • Used to specify a title in the window title bar • Search engines and people rely on titles <title>Ahsan Rahim – UX/UI - </title>
  • 20. <head> SECTION: <meta> • Meta tags additionally describe the content contained within the page <meta name="description" content="HTML tutorial" /> <meta name="keywords" content="html, web design, styles" /> <meta name="author" content="Chris Brewer" /> <meta http-equiv="refresh" content="5; url=http://ahsanrahim.freeweb.pk" />
  • 21. <head> SECTION: < script > • The <script> element is used to embed scripts into an HTML document • Script are executed in the client's Web browser • Scripts can live in the <head> and in the <body> sections • Supported client-side scripting languages: • JavaScript (it is not Java!) • VBScript • JScript
  • 22. THE <script> TAG – EXAMPLE • scripts-example.html<!DOCTYPE HTML> <html> <head> <title>JavaScript Example</title> <script type="text/javascript"> function sayHello() { document.write("<p>Hello World!</p>"); } </script> </head> <body> <script type= "text/javascript"> sayHello(); </script> </body> </html>
  • 23. <head> SECTION: <style> • The <style> element embeds formatting information (CSS styles) into an HTML page <html> <head> <style type="text/css"> p { font-size: 12pt; line-height: 12pt; } p:first-letter { font-size: 200%; } span { text-transform: uppercase; } </style> </head> <body> <p>Styles demo.<br /> <span>Test uppercase</span>. </p> </body> </html> style-example.html
  • 24. COMMENTS: <!-- --> TAG • Comments can exist anywhere between the <html></html> tags • Comments start with <!-- and end with --> <!–- Telerik Logo (a JPG file) --> <img src="logo.jpg" alt=“Telerik Logo"> <!–- Hyperlink to the web site --> <a href="http://telerik.com/">Telerik</a> <!–- Show the news table --> <table class="newstable"> ...
  • 25. <body> SECTION: INTRODUCTION • The <body> section describes the viewable portion of the page • Starts after the <head> </head> section • Begins with <body> and ends with </body> <html> <head><title>Test page</title></head> <body> <!-- This is the Web page body --> </body> </html>
  • 26. TEXT FORMATTING • Text formatting tags modify the text between the opening tag and the closing tag • Ex. <b>Hello</b> makes “Hello” bold
  • 27. TEXT FORMATTING – EXAMPLE • text-formatting.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Page Title</title> </head> <body> <h1>Notice</h1> <p>This is a <em>sample</em> Web page.</p> <p><pre>Next paragraph: preformatted.</pre></p> <h2>More Info</h2> <p>Specifically, we’re using XHMTL 1.0 transitional.<br /> Next line.</p> </body> </html>
  • 28. TEXT FORMATTING – EXAMPLE (2) • text-formatting.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Page Title</title> </head> <body> <h1>Notice</h1> <p>This is a <em>sample</em> Web page.</p> <p><pre>Next paragraph: preformatted.</pre></p> <h2>More Info</h2> <p>Specifically, we’re using XHMTL 1.0 transitional.<br /> Next line.</p> </body> </html>
  • 29. HYPERLINKS: <a> TAG • Link to a document called form.html on the same server in the same directory: • Link to a document called parent.html on the same server in the parent directory: • Link to a document called cat.html on the same server in the subdirectory stuff: <a href="form.html">Fill Our Form</a> <a href="../parent.html">Parent</a> <a href="stuff/cat.html">Catalog</a>
  • 30. HYPERLINKS: <a> TAG (2) • Link to an external Web site: • Always use a full URL, including "http://", not just "www.somesite.com" • Using the target="_blank" attribute opens the link in a new window • Link to an e-mail address: <a href="http://www.example.com" target="_blank">Example</a> <a href="mailto:bugs@example.com?subject=Bug+Report"> Please report bugs here (by e-mail only)</a>
  • 31. HYPERLINKS: <a> TAG (3) • Link to a document called apply-now.html • On the same server, in same directory • Using an image as a link button: • Link to a document called index.html • On the same server, in the subdirectory english of the parent directory: <a href="apply-now.html"><img src="apply-now-button.jpg" /></a> <a href="../english/index.html">Switch to English version</a>
  • 32. HYPERLINKS AND SECTIONS • Link to another location in the same document: • Link to a specific location in another document: <a href="#section1">Go to Introduction</a> ... <h2 id="section1">Introduction</h2> <a href="chapter3.html#section3.1.1">Go to Section 3.1.1</a> <!–- In chapter3.html --> ... <div id="section3.1.1"> <h3>3.1.1. Technical Background</h3> </div>
  • 33. HYPERLINKS – EXAMPLE • hyperlinks.html <a href="form.html">Fill Our Form</a> <br /> <a href="../parent.html">Parent</a> <br /> <a href="stuff/cat.html">Catalog</a> <br /> <a href="http://ahsanrahim.freeweb.pk" target="_blank">BASD</a> <br /> <a href="mailto:bugs@example.com?subject=Bug Report">Please report bugs here (by e-mail only)</a> <br /> <a href="apply-now.html"><img src="apply-now-button.jpg” /></a> <br /> <a href="../english/index.html">Switch to English version</a> <br />
  • 34. HYPERLINKS – EXAMPLE (2) • hyperlinks.html <a href="form.html">Fill Our Form</a> <br /> <a href="../parent.html">Parent</a> <br /> <a href="stuff/cat.html">Catalog</a> <br /> <a href="http://ahsanrahim.freeweb.pk" target="_blank">BASD</a> <br /> <a href="mailto:bugs@example.com?subject=Bug Report">Please report bugs here (by e-mail only)</a> <br /> <a href="apply-now.html"><img src="apply-now-button.jpg” /></a> <br /> <a href="../english/index.html">Switch to English version</a> <br />
  • 35. LINKS TO THE SAME DOCUMENT – EXAMPLE (2) • links-to-same-document.html <h1>Table of Contents</h1> <p><a href="#section1">Introduction</a><br /> <a href="#section2">Some background</A><br /> <a href="#section2.1">Project History</a><br /> ...the rest of the table of contents... <!-- The document text follows here --> <h2 id="section1">Introduction</h2> ... Section 1 follows here ... <h2 id="section2">Some background</h2> ... Section 2 follows here ... <h3 id="section2.1">Project History</h3> ... Section 2.1 follows here ...
  • 36. IMAGES: <img> TAG • Inserting an image with <img> tag: • Image attributes: • Example: <img src="/img/basd-logo.png"> <img src="./php.png" alt="PHP Logo" />
  • 37. MISCELLANEOUS TAGS • <hr />: Draws a horizontal rule (line): • <center></center>: Deprecated! • <font></font>: Deprecated! <hr size="5" width="70%" /> <center>Hello World!</center> <font size="3" color="blue">Font3</font> <font size="+4" color="blue">Font+4</font>
  • 38. MISCELLANEOUS TAGS – EXAMPLE • misc.html <html> <head> <title>Miscellaneous Tags Example</title> </head> <body> <hr size="5" width="70%" /> <center>Hello World!</center> <font size="3" color="blue">Font3</font> <font size="+4" color="blue">Font+4</font> </body> </html>