Welcome to Lecture 3 of the Web Development course.
In this lecture, we will continue learning advanced HTML concepts and introduction to CSS.
Links are used to connect webpages, files, sections, and external websites.
HTML uses the <a> tag to create links.
<a href="https://google.com">Visit Google</a>
Internal links connect pages inside the same website.
<a href="about.html">About Us</a>
External links connect to another website.
<a href="https://facebook.com">Facebook</a>
Self links move users to another section on the same webpage.
<a href="#contact">Go to Contact Section</a> <h2 id="contact">Contact Us</h2>
Defines the destination URL.
<a href="about.html">About</a>
Shows tooltip text when hovering on a link.
<a href="about.html" title="About Our Company">About</a>
Defines where the link should open.
| Value | Description |
|---|---|
| _self | Open in same tab |
| _blank | Open in new tab |
<a href="https://google.com" target="_blank">
Open Google
</a>
Defines relationship between current page and linked page.
<a href="https://example.com" rel="nofollow">
Example Link
</a>
| Value | Purpose |
|---|---|
| nofollow | Search engines should not follow the link |
| noopener | Security for new tabs |
| noreferrer | Hide referral information |
DOCTYPE tells the browser which HTML version is being used.
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
Meta tags provide information about the webpage.
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Learn HTML and CSS">
<meta name="keywords" content="HTML, CSS, Web Development">
<meta name="author" content="Join Webs">
<html> </html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Welcome</h1>
</body>
<iframe src="https://example.com"></iframe>
<iframe src="page.html" width="600" height="400"></iframe>
Developer tools help developers inspect and debug websites.
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ol>
<ul>
<li>Apple</li>
<li>Mango</li>
<li>Orange</li>
</ul>
| Tag | Purpose |
|---|---|
| table | Create Table |
| tr | Table Row |
| td | Table Data |
| th | Table Heading |
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Ali</td>
<td>22</td>
</tr>
</table>
<table width="500"> <table height="300"> <table class="mytable"> <table id="table1"> <table name="studenttable"> <table style="background:red;">
<table cellpadding="10">
<table cellspacing="5">
<table border="1">
<td colspan="2">Combined Column</td>
A table inside another table is called a nested table.
<table border="1">
<tr>
<td>
<table border="1">
<tr>
<td>Nested Table</td>
</tr>
</table>
</td>
</tr>
</table>
CSS stands for Cascading Style Sheets.
CSS is used to style and design webpages.
One CSS file can style multiple webpages.
External CSS files are cached by browsers which improves website performance.
<h1 style="color:red;">Hello World</h1>
<head>
<style>
h1 {
color: blue;
}
</style>
</head>
<link rel="stylesheet" href="style.css">
/* style.css */
h1 {
color: green;
}
<!DOCTYPE html>
<html>
<head>
<title>Lecture 3</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial;
}
</style>
</head>
<body>
<h1>Welcome to Lecture 3</h1>
<a href="about.html">Internal Link</a>
<br><br>
<a href="https://google.com" target="_blank">
External Link
</a>
<h2>Student List</h2>
<ul>
<li>Ali</li>
<li>Ahmed</li>
<li>Usman</li>
</ul>
<table border="1" cellpadding="10">
<tr>
<th>Name</th>
<th>Marks</th>
</tr>
<tr>
<td>Ali</td>
<td>90</td>
</tr>
</table>
</body>
</html>
In the next lecture, we will continue with more advanced HTML and CSS concepts.