This document provides an introduction to web technologies and HTML. It discusses the differences between the Internet and the World Wide Web. It then covers the history and origins of the web from Ted Nelson's work on hypertext to Tim Berners-Lee creating HTTP and HTML. The document proceeds to explain key web concepts like HTTP, URLs, HTML markup tags and elements, images, hyperlinks, tables, and directory structures for web projects.
3. Internet Vs. WWW
Internet
World Wide network of
networks.
Exchange information via
different protocols like
HTTP, FTP, SMTP, IMAP,
………..
The Web (www)
A subset of the internet
Uses HTTP to access and
exchange information.
It is a collection of HTML
documents.
14. HTML
Not a programming language but a MARKUP Language.
Uses tags and keywords.
It is a text file that is saved .html, can be edited with any
text editor.
It is viewed in a browser
It is used for structuring contents of a web page
No layout or styles must be used in HTML (only in css
files)
15. HTML Markup
HTML Elements
HTML document is a tree with one node (html node)
Built on tags < and >
HTML document is made up of elements
Elements has an opening tag with name and has content.
<name> Content Here </name>
Content can be text or another tag
Examples:
<b> This text appears bold </b>
<em>emphasized text</em>
16. HTML Markup (Cont’d)
HTML attributes
HTML attributes are modifiers of HTML elements,
in name-value pair format. It is recommended to
put values in double quotations.
name=“value”
<tag attr=“value”>content</tag>
Examples:
<a href=http://www.google.com> Go To Google </a>
17. HTML Markup (Cont’d)
Empty elements
Has no close tags and no contents
Has an open tag and attributes only
Optionally the open tag can has a / at the end (XHTML)
Examples:
<br> or <br />
<hr>
<img src=“earth.jpg” alt=“Picture of the earth”>
18. HTML Markup (Cont’d)
Comment Elements
To insert comments in the source code.
Are not displayed in the browsers.
<!--This is a comment. Comments are not displayed in
the browser-->
24. NOTES
All whitespaces , tabs and newlines are interpreted as one
whitespace
Except if inside <pre> tag
To add a newline use <br>
To add one whitespace use (escape character)
To get a list of escape characters
http://www.theukwebdesigncompany.com/articles/entity-escapecharacters.php
25. HTML Document Object
Model (DOM)
A web browser:
reads HTML documents (parsing phase)
Then renders the document (rendering phase)
Parsing phase:
reads the markup in the document,
breaks it down into components,
builds a document object model (DOM) tree.
Node: each object in the DOM tree (element nodes/text
nodes).
Root node is the html element.
There are child, parent, descendants, ancesters and sibling
nodes.
27. images
<img src=“url” alt=“text” >
Empty element
alt is the alternate text that will appear when image isn’t
loaded yet.
src is
An absolute URL - points to another web site (like
src="http://www.example.com/image.gif")
A relative URL - points to a file within a web site (like
src="image.gif")
28. Hyperlinks
Created using anchor <a> tag
Links a webpage to others
Link to External pages
<a href=http://www.google.com>Go to google</a>
Link to pages in the same website
<a href=“pagesbooks.html”>Favourite Books</a>
29. Hyperlink (Cont’d)
Link to a certain fragment in the current or another
page
<a href=“book1.html#ch1”>Chapter 1</a>
We need to create an anchor with a name attribute to
identify it in the url.
<a name=“ch1”>Chapter 1</a>
To link to send email, opens default email client
<a href=mailto:user@server.com>Press to send email</a>
31. Tables
Used to display tabular data
Tables fit contents, don’t take all length
Never use it to format content, better use tableless
approach with css
HyperText: is text which is not constrained to be linear. A text which is contains links to other text, non-sequential writing.Term invented by Ted Nelson in his project Xanada.Hypermedia: is hypertext including graphics, video and sound.
In the early nineties, worked on a hypertext GUI browser and editor , named “World Wide Web”
HTTP (Hyper Text Transfer Protocol) is the main part of the web. A protocol for communicating between browser and web server.TCP/IP communication protocol to deliver all files and data (HTML files, images …….)
Connectionless each http request is independent of any preceding or subsequent requests. After sending a request the client is disconnected from the server.Media Independent any data can be sent as long as client and server can handle it.Stateless since it is connectionless, server and client don’t remember each other after the end of the request.
Crcarriage return \r ascii 13Lf line feed \n ascii 10Example: GET /index.html HTTP/1.1Host:www.google.comUser-Agent:Mozilla/3.0Last-Modified:Fri, 3 Dec 1999 22:22:34 GMTMethods GET retrieve information identified by Request URI POST accept entity enclosed in request as a HEAD no message body is sent in the response DELETE request the origin server delete the resource identified request URI PUT request that enclosed entity be stored under the supplied request URI
PopularStatus codes and phrases, 1xx informational,2xxSuccess, 3xxRedirection, 4xxclient error, 5xxserver error 200 OK 201 created 301 Moved Permeanantly 400 Bad Request 401 UnAuthorized 404 Not Found 505 http version not supported
Brief HistoryLate 80’s Tim Berner Lee wrote first HTML1994 HTML 2, Netscape is formed1995 HTML 3, MS IE came out, Netscape proposed frames1997 HTML 3.2 then start on HTML 41999 HTML 4.012000 XHTML 1.0, 2001 XHTML 1.1 , 2009 abandoned XHTML 22008 start on HTML 5
Separation of concernsHTML Content onlyCSS presentation
ML is annoted text so computer can manipulate the text, are human readable.
Create a .html file try simple tagsa,h1,h2,p,br,hr,em,address,pre
Only one root <html>Root has only 2 children <head>, <body> nothing is outside these 2 tags<head> contains tags that provide information to the browser and search engines, links to css and js external files
Create a .html file try simple tagsa,h1,h2,p,br,hr,em,address,pre
Note: borders are added for better illustration but the code will not create them
Create a .html file try simple tagsa,h1,h2,p,br,hr,em,address,pre