Lec 1 HTML
Lec 1 HTML
HTML5
Lecture-1
What is HTTP?
HTTP stands for Hyper Text Transfer Protocol
WWW is about communication between web clients and
servers.
Communication between client computer and web server
is done by sending HTTP Requests and receiving HTTP
Responses.
Clients are often browsers(Chrome, Safari, Mozila, etc)
Servers are most often computers in cloud.
HTTP Request/Response
Communication between client and server is done by
requests and responses:
1. A client (a browser) sends an HTTP request to the web
2. An web server receives the request
3. The server runs an application to process the request
4. The server returns an HTTP response (output) to the
browser
5. The client (the browser) receives the response
What is HTML5?
HTML5 is the newest version of HTML, only recently
gaining partial support by the makers of web browsers.
It incorporates all features from earlier versions of HTML,
including the stricter XHTML.
It adds a diverse set of new tools for the web developer
to use.
History of HTML
<!DOCTYPE html>
Just 15 characters!
The DOCTYPE tells the browser which type and version of document to
expect. This should be the last time the DOCTYPE is ever changed. From
now on, all future versions of HTML will use this same simplified declaration.
The <html> Element
This is what the <html> element looked like in XHTML:
The lang attribute in the <html> element declares which language the page
content is in. Though not strictly required, it should always be specified, as it
can assist search engines and screen readers.
Each of the world’s major languages has a two-character code, e.g. Spanish = "es",
French = "fr", German = "de", Chinese = "zh", Arabic = "ar".
The <head> Section
Here is a typical XHTML <head> section:
<head>
<title>My First XHTML Page</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<head>
<title>My First HTML5 Page</title>
<link rel="stylesheet" href="style.css">
</head>
Basic HTML5 Web Page
Putting the prior sections together, and now adding the <body> section and
closing tags, we have our first complete web page in HTML5:
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First HTML5 Page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>HTML5 is fun!</p>
</body>
</html>
Even though we used HTML5, the page looks exactly the same in a web
browser as it would in XHTML. Without looking at the source code, web
visitors will not know which version of HTML the page was created with.
Structural Tags
<HTML>
These tags enclose the entire Web page document.
</HTML>
<HEAD>
These tags enclose the Head part of the document
</HEAD>
<TITLE>
These tags enclose the title of the document. This text appears in the
title bar in the browser and on the bookmark list if someone bookmarks
your web page.
</TITLE>
Sample Structure of a Web Site
<HTML>
<HEAD>
<TITLE> John Q. Public's Web Page </TITLE>
</HEAD>
<BODY>
This is John Public's Webpage!
</BODY>
</HTML>
Header Tags
Header Tags -- Used for marking sections and subsections
in a document.
Tag Result
Big Small
This is red
i = i. Item One I = I. Item One a = a. Item One A = A. Item One 1 = 1.Item One
ii. Item Two II. Item Two b. Item Two B. Item Two 2. Item Two
iii. Item Three III. Item Three c. Item Three C. Item Three 3. Item Three
iv. Item Four IV. Item Four d. Item Four D. Item Four 4. Item Four
start="xx"
• This attribute lets you specify which number/letter will start the list
Lists -- Definition Lists
Definition Lists:
<DL>
<DT>List Name One
<DD>This is where information about List Name One would go</DD>
</DT>
<DT>List Name Two
<DD>This is where information about List Name Two would go</DD>
</DT>
</DL>