Professional Documents
Culture Documents
Web Technologies Week 02-03 (HTML)
Web Technologies Week 02-03 (HTML)
Web Technologies Week 02-03 (HTML)
Week 02-03
Introduction to HTML
01 Recap of Week 01
02 What is HTML?
Recap of
Week 01
• Tag Pairs: HTML tags come in pairs, with an opening tag (<tag>) and a
closing tag (</tag>), and elements are formed by combining these tags.
• Attributes: Tags can have attributes like "src" for images, providing extra
information to control how elements are displayed.
• Browser Rendering: Web browsers read HTML code and convert it into
visible web pages, showing content as intended by interpreting the tags
and attributes.
Prepared by Mian Muhammad Talha 7
HTML
• Or IDEs like
• Visual Studio Code
• Sublime Text
• Atom
• Adobe Dreamweaver
• HTML tags are hidden keywords that control formatting of a web page in
the browser and define the display of content
• Most tags have both start and end. Few tags only have start
<!DOCTYPE HTML>
<html>
<head>
HTML <title>My First HTML Page</title>
</head>
Tags <body>
<p>This is some text...</p>
</body>
</html> Eleven (11 Tags)
How many tags are there?
Prepared by Mian Muhammad Talha 12
HTML Elements
• HTML elements are not hidden keywords which means whatever referred
between the starting and closing tag shown on the screen exactly as it is
<!DOCTYPE HTML>
<html>
<head>
HTML <title>My First HTML Page</title>
</head>
Elements <body>
<p>This is some text...</p>
</body>
Five (05
</html>
Elements)
How many Elements are there?
Prepared by Mian Muhammad Talha 14
HTML Header & Body
<!DOCTYPE HTML>
<html>
HTML header
Header <head>
<title>My First HTML Page</title>
/ </head>
<body>
Body <p>This is some text...</p>
</body>
</html> HTML body
• Each attribute has a name and a value, and appears within the element's
start tag
• Start tag may contain any number of name/value pairs separated by spaces
<!DOCTYPE HTML>
Here it is a
<html> document type
<head> declaration (also
called DOCTYPE
<title>My First HTML Page</title> declaration) that
</head> identifies this
document as an
<body> HTML5
document.
<p>This is some text...</p>
<img src= "logo.gif" alt= "logo" />
</body>
</html>
<body>
</body>
Visit Website: This is the visible text that users will see on the webpage.
When clicked, this text will act as the link to the specified URL.
Prepared by Mian Muhammad Talha 24
Anchor Tag
You can also use anchor tags to create links within the same webpage
(known as internal links) using relative URLs. For example:
<a href="https://www.facebook.com"
target="_blank">Facebook</a>
</body>
<th>: Represents a table header cell, typically used for column or row
headers.
<td>: Represents a table data cell, where the actual data is placed.
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td> <table border="solid">
<td>Data 2</td>
</tr>
</table>
• Forms are a crucial component of user interaction on the web and are
widely used to collect and process user input.
width and height Attributes: You can use these attributes to define the
dimensions of elements like images and table cells.
border Attribute: The border attribute specifies the border width of table
cells.
<table border=“1">
<!-- Table content here -->
</table>
bgcolor and color Attributes (Text Colors): The bgcolor attribute changes
the background color of the text, and the color attribute sets the text color.