HTML 1
HTML 1
HTML Example
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<>My !irst aragrah"</>
</body>
</html>
Try it yourself
Example Explained
The DOCTYPE declaration defines the document type
The text beteen !html" and !#html" describes the eb pa$e
The text beteen !body" and !#body" is the %isible pa$e content
The text beteen !h&" and !#h&" is displayed as a headin$
The text beteen !p" and !#p" is displayed as a para$raph
The !'DOCTYPE html" declaration is the doctype for HTML()
*hat is HTML+
HTML is a lan$ua$e for describin$ eb pa$es)
HTML stands for Hyper Text Mar,up Lan$ua$e
HTML is a markup lan$ua$e
- mar,up lan$ua$e is a set of mar,up tags
The ta$s describe document content
HTML documents contain HTML tags and plain text
HTML documents are also called web pages
HTML Ta$s
HTML mar,up ta$s are usually called HTML ta$s)
HTML ta$s are ,eyords .ta$ names/ surrounded by angle brackets li,e !html"
HTML ta$s normally come in pairs li,e !p" and !#p"
The first ta$ in a pair is the start tag, the second ta$ is the end tag
The end ta$ is ritten li,e the start ta$0 ith a slash before the ta$ name
1tart and end ta$s are also called opening tags and closing tags
!ta$name"content!#ta$name"
HTML Elements
In HTML0 most elements are ritten ith a start ta$ .e)$) !p"/ and an end ta$ .e)$) !#p"/0 ith the
content in beteen2
!p"This is a para$raph)!#p"
*eb 3rosers
The purpose of a eb broser .such as 4oo$le Chrome0 Internet Explorer0 5irefox0 1afari/ is to read
HTML documents and display them as eb pa$es)
The broser does not display the HTML ta$s0 but uses the ta$s to determine ho the content of the
HTML pa$e is to be presented#displayed to the user2
HTML Pa$e 1tructure
3elo is a %isuali6ation of an HTML pa$e structure2
!html"
!body"
!h&"This a headin$!#h&"
!p"This is a para$raph)!#p"
!p"This is another para$raph)!#p"
!#body"
!#html"
HTML 7ersions
1ince the early days of the eb0 there ha%e been many %ersions of HTML2
Version Year
HTML &88&
HTML9 &88:
HTML ;)< &88(
HTML :); &88=
HTML >)<& &888
?HTML ;<<<
HTML( ;<&;
The !'DOCTYPE" Declaration
The !'DOCTYPE" declaration helps the broser to display a eb pa$e correctly)
There are many different documents on the eb0 and a broser can only display an HTML pa$e &<<@
correctly if it ,nos the HTML %ersion and type used)
Common Declarations
HTML(
<!DOCTYPE html>
HTML >)<&
<!DOCTYPE HTM# P$%#&C '(//)*C//DTD HTM# +",1 Transitional//E-'
'htt./////"/*"org/T0/html+/loose"dtd'>
?HTML &)<
<!DOCTYPE html P$%#&C '(//)*C//DTD 1HTM# 1", Transitional//E-'
'htt./////"/*"org/T0/2html1/DTD/2html1(transitional"dtd'>