Professional Documents
Culture Documents
Lecture 2
Lecture 2
Self Study..
“Formal education will make you a living; self-education will make you a
fortune.”
– Jim Rohn
Hypertext Markup Language (HTML) is the language for specifying the static
content of Web pages
Hypertext is text which contains links to other texts. Hypertext refers to the fact
that Web pages are more than just text
Markup refers to the fact that it works by augmenting text with special symbols
(tags) that identify structure and content type
Tags vs Elements
HTML specifies a set of tags that identify structure and content type
Tags are enclosed in < >
<img src="image.gif" /> specifies an image
HTML elements follow a certain format regardless of how the element is used.
An HTML element starts with a start tag/opening tag.
An HTML element ends with an end tag/closing tag.
The element content is everything between the start and the end tag.
Some HTML elements have empty content.
Empty elements are closed in the start tag.
Most HTML elements can have attributes.
HTML & Trees
Nested Elements
HTML Attributes
When you save an HTML file, you can use either the .htm or the .html
extension.
Structure of html
HTML document has two main structural elements
HEAD contains setup information for the browser & the Web page
e.g., the title for the browser window, style definitions, JavaScript
code, …
BODY contains the actual content to be displayed in the Web page
<html>
<head>
</head>
<body>
Text that appears in the page
</body>
</html>
HTML5 basic tag division diagram
HTML Title
Title icon
<link rel="shortcut icon" type="image/x-icon" href="icon.jpg" />
Title element
<HTML>
<HEAD>
<TITLE>Al al-Bayt University</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
HTML Headings
The URL points to the location or address where the image is stored.
An image file named "boat.gif" located in the directory "images" on
"www.w3schools.com" has the URL.
http://www.w3schools.com/images/boat.gif
Insert Images from Different Locations
<html>
<body background="background.jpg">
<h3>Look: A background image!</h3>
<p>Both gif and jpg files can be used as HTML backgrounds.</
p>
<p>If the image is smaller than the page, the image will repeat
itself.</p>
</body>
</html>
Aligning Images
<html>
<body>
<p>The text is aligned with the image
<img src="hackanm.gif" align="bottom" width="48" height="48"
/>
at the bottom.</p>
</body>
</html>