

3RD Quarter Lesson HTML
Presentation
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Honey Fate Joy Villegas
Used 5+ times
FREE Resource
66 Slides • 86 Questions
1
HTML Favicon
By Honey Fate Joy Villegas
2
HTML Favicon
By Honey Fate Joy Villegas
A favicon is a small image displayed next to the page title in the browser tab.
3
How To Add a Favicon in HTML
You can use any image you like as your favicon. You can also create your own favicon on sites like https://www.favicon.cc.
Tip: A favicon is a small image, so it should be a simple image with high contrast.
4
A favicon image is displayed to the left of the page title in the browser tab, like this:
To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".
Next, add a element to your "index.html" file, after the
5
Example
<!DOCTYPE html>
<html>
<head>
<title>My Page Title</title>
<link rel="icon" type="image/x-icon" href="/images/favicon.ico">
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
6
Favicon File Format Support
The following table shows the file format support for a favicon image:
Browser | ICO | PNG | GIF | JPEG | SVG |
|---|---|---|---|---|---|
Edge | Yes | Yes | Yes | Yes | Yes |
Chrome | Yes | Yes | Yes | Yes | Yes |
Firefox | Yes | Yes | Yes | Yes | Yes |
Opera | Yes | Yes | Yes | Yes | Yes |
Safari | Yes | Yes | Yes | Yes | Yes |
7
Multiple Choice
In which HTML element is the Favicon defined?
The <img> element
The <body> element
The <link> element
The <style> element
8
Fill in the Blank
Which HTML tag is used to handle the favicon (the little image to the left in the browser tab); < ______rel="icon" type="image/x-icon" href="/images/favicon.ico">?
9
Multiple Choice
True or False. Favicons must have the .ico file extension.
true
false
10
Add Favicon
We use the HTML tag to attach a favicon to the document. For example,
<link rel="shortcut icon" href="/images/favicon.ico">
​
​
<head> <title>Programiz: Learn to Code for Free!</title> <link rel="shortcut icon" href="favicon.png"> </head>
Let us look at how this would look on a real site. For example, programiz.com might have something like this in their code,
11
​
​
Here the favicon.png is being displayed from the tag in the program site where:
rel - defines the type of document linked, i.e. a shortcut icon
href - defines the URL for the icon
​Note: You can use almost any image for the favicon. However, a simple, easy-to-recognize, small (usually 16px X 16px) image is recommended. Most websites use their logo or a smaller version of the logo as the favicon.
12
​
​
​
Welcome to my websiteGeeksforGeeks
Debugging Activity: HTML Favicon Troubleshooting
Instructions:
Review the HTML code below.
The favicon is not appearing in the browser tab.
Find and correct all the errors related to the favicon setup.
Write the corrected code after debugging.
13
<!DOCTPE html>
<html lang="en">
<head>
<meta charset="UTF8">
<meta name="viewport" content="width=device-width, initial scale=1.0">
<title>My Webpage</title>
<!-- Favicon setup -->
<link rel="icons" type="images/x-icon" href="favicons.ico">
<style>
h1 {
color: white;
background-color: white;
font-size: 30px;
}
</style>
</head>
<body>
<h1>It's nice to meet you Ma'am Honey</h1>
</body>
</html>
14
Open Ended
Review the HTML code below.
The favicon is not appearing in the browser tab.
Find and correct all the errors related to the favicon setup.
Write the corrected code after debugging.
15
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Webpage</title>
<!-- Correct Favicon setup -->
<link rel="icon" type="image/x-icon" href="favicon.ico">
<style>
h1 {
color: black;
background-color: transparent;
font-size: 30px;
}
</style>
</head>
<body>
<h1>It’s nice to meet you Ma'am Honey</h1>
</body>
</html>
Answer key
16
Summary of Errors
# | Error Location | Error Description | Correct Version | Effect of the Error |
1 | <!DOCTPE html> | Misspelled DOCTYPE declaration ( | <!DOCTYPE html> | May cause inconsistent page rendering |
2 | <meta charset="UTF8"> | Missing hyphen in character encoding | <meta charset="UTF-8"> | Can cause character display problems |
3 | <meta name="viewport" content="width=device-width, initial scale=1.0"> | Missing hyphen between “initial” and “scale” | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | Makes the page unresponsive or improperly scaled |
4 | <link rel="icons" ...> | Wrong attribute value ( | <link rel="icon" ...> | Favicon not recognized by browser |
5 | type="images/x-icon" | Typo in MIME type ( | type="image/x-icon" | Favicon won’t load |
6 | href="favicons.ico" | Wrong file name ( | href="favicon.ico" | Browser can’t find the favicon file |
7 | CSS | Same text and background color | Use contrasting colors, e.g. | Text appears invisible on the page |
| | | | |
17
18
19
20
21
22
23
24
25
26
27
28
Multiple Choice
Why is the DOCTYPE declaration important at the beginning of an HTML document?
It makes the text appear in bold
It tells the browser which version of HTML is being used
It creates the title of the webpage
It makes the page load faster
29
Multiple Choice
Which statement best explains why the head tag contains "metadata"?
The head tag makes text appear larger
The head tag contains information about the page, not the actual page content
The head tag is where all images go
The head tag makes the page load in a new window
30
Multiple Choice
If you wanted visitors to see "My School Project" in their browser tab, where would you place this text?
Inside the body tag
Inside an h1 tag
Inside the title tag within the head section
At the very top of the document
31
Multiple Choice
Why can't you just write text directly inside the HTML tag without using head and body tags?
The browser won't know whether the text is information about the page or actual page content
The text will appear too small
The page will load too slowly
The text will appear in the wrong color
32
Multiple Choice
If you wanted to add more information about your webpage (like the author's name), where would this information most likely belong?
In the body tag with the visible content
In the head tag as metadata
Before the DOCTYPE declaration
After the closing HTML tag
33
🧩 HTML Debugging Activity Activity Title: Debugging a Basic HTML Page Objective: Identify and correct the errors in the HTML code to make the webpage display correctly.
<!DOCTPE html>
<html lang="en">
<head>
<meta charset="UTF8">
<meta name="viewport" content="width=device-width, initial scale=1.0">
<title>My Webpage<title>
<link rel="icons" type="images/x-icon" href="favicons.ico">
</head>
<body background-color="lightblue">
<h1>Welcome To My Webpage<h1>
<p>HTML is the standerd markup language for creating Web pages<p>
<img src="image.jpg" alt="My Image" widht="300" heigth="200">
<a href="www.google.com" target="blank">Visit Google<a>
</body>
</html>
34
Open Ended
Identify and correct the errors in the HTML code to make the webpage display correctly.
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Webpage</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<style>
body {
background-color: lightblue;
}
</style>
</head>
<body>
<h1>Welcome to My Webpage</h1>
<p>HTML is the standard markup language for creating web pages.</p>
<img src="image.jpg" alt="My Image" width="300" height="200">
<a href="https://www.google.com" target="_blank">Visit Google</a>
</body>
</html>
Answer key
36
Error | Correction | Explanation |
|---|---|---|
<!DOCTPE html> | <!DOCTYPE html> | The DOCTYPE declaration was misspelled. It must be DOCTYPE to tell the browser it’s an HTML5 document. |
<meta charset="UTF8"> | <meta charset="UTF-8"> | The correct character encoding is UTF-8, not UTF8. The dash is required. |
initial scale=1.0 | initial-scale=1.0 | In the viewport meta tag, property names must use hyphens. |
<title>My Webpage<title> | <title>My Webpage</title> | The closing tag was missing a slash /. |
<link rel="icons" type="images/x-icon"> | <link rel="icon" type="image/x-icon"> | rel="icon" and type="image/x-icon" are the correct attributes. |
body background-color="lightblue" | Added <style> block | You can’t set background color directly as an HTML attribute; use CSS instead. |
<h1>Welcome To My Webpage<h1> | <h1>Welcome to My Webpage</h1> | Missing closing tag / and corrected capitalization for readability. |
<p>...<p> | <p>...</p> | Paragraphs must be properly closed with </p>. |
widht, heigth | width, height | Attribute names were misspelled. |
href="www.google.com" | href="https://www.google.com" | URLs must include a protocol (https://) to be valid links. |
target="blank" | target="_blank" | The underscore is required before blank to open links in a new tab. |
37
38
39
40
41
42
43
44
45
46
HTML Table Borders
HTML tables can have borders of different styles and shapes.
47
HTML Table Borders
Example
table, th, td {
border: 1px solid black;
}
48
49
HTML Table Borders
50
HTML Table Borders
​Example table, th, td { border: 1px solid black; border-collapse: collapse; }
51
Style Table Borders
If you set a background color of each cell, and give the border a white color (the same as the document background), you get the impression of an invisible border:
52
Style Table Borders
Example
table, th, td {
border: 1px solid white;
border-collapse: collapse;
}
th, td {
background-color: #96D4D4;
}
53
Round Table Borders
With the border-radius property, the borders get rounded corners:
54
Skip the border around the table by leaving out table from the css selector:
​Example th, td { border: 1px solid black; border-radius: 10px; }
55
Dotted Table Borders
With the border-style property, you can set the appearance of the border.
56
Dotted Table Borders
Example
th, td {
border-style: dotted;
}
57
Border Color
With the border-color property, you can set the color of the border.
58
Border Color
Example
th, td {
border-color: #96D4D4;
}
59
HTML Table Sizes
HTML tables can have different sizes for each column, row or the entire table.
Use the style attribute with the width or height properties to specify the size of a table, row or column.
60
HTML Table Width
To set the width of a table, add the style attribute to the <table> element:
Example
Set the width of the table to 100%:
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
Note: Using a percentage as the size unit for a width means how wide will this element be compared to its parent element, which in this case is the element.
61
HTML Table Width
To set the size of a specific column, add the style attribute on a <th> or <td> element:
Example
Set the width of the first column to 70%:
<table style="width:100%">
<tr>
<th style="width:70%">Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
Note: Using a percentage as the size unit for a width means how wide will this element be compared to its parent element, which in this case is the element.
62
HTML Table Row Height
To set the height of a specific row, add the style attribute on a table row element:
Example
Set the height of the second row to 200 pixels:
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr style="height:200px">
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
63
64
Multiple Choice
65
Multiple Choice
66
Multiple Choice
67
Multiple Choice
68
Multiple Choice
69
Multiple Choice
70
Multiple Choice
71
Multiple Choice
<a href = “ “ > … <a/>
72
Multiple Choice
73
Multiple Choice
74
Multiple Choice
What is the correct CSS property for styling the border of a table?
table style
table border
border
75
Multiple Choice
What is the correct CSS code to turn this table:
border-span: single;
border-collapse: collapse;
border-implode: implode;
76
Fill in the Blank
Use the correct CSS border values to create a solid black 3-pixels border on a table element.
77
Multiple Choice
What is the correct CSS property for styling the width of a table?
size
table size
width
78
Multiple Choice
To specify a table width, you are only allowed to use percentages as a value.
True
False
79
Multiple Choice
What is a favicon?
A social media platform
A video streaming service
A type of browser extension
A small icon that identifies a website
80
Multiple Choice
Where do most browsers display a website's favicon?
Left side of the address bar
Right side of the address bar
Below the URL
Above the URL
81
Multiple Choice
Which browser only displays favicons in the page tabs?
Firefox
Internet Explorer
Safari
Google Chrome
82
Fill in the Blank
Use CSS styles to make the table 300 pixels wide.
83
🧩 HTML Debugging Activity: Tables
Activity Title: Debugging an HTML Table
Objective: Identify and fix the HTML table errors to correctly display the data in a well-formatted table.
<!DOCTPE html>
<html>
<head>
<title>Student Grades</title>
</head>
<body>
<h2>Student Grade Table<h2>
<table border="1" cellpadding="5" cellspacing="5"
<tr>
<th>Student Name
<th>Subject
<th>Grade
</tr>
<tr>
<td>Maria Santos</td>
<td>Math</td>
<td>95
<tr>
<td>Juan Dela Cruz
<td>Science</td>
<td>89</td>
<tr>
<td>Ana Reyes</td>
<td>English</td>
<td>92</td>
</table>
</body>
</html>
84
Open Ended
85
Answer Key
86
HTML Table Headers
Sometimes you want your cells to be table header cells. In those cases use the tag instead of the tag:
th stands for table header.
<table>
<tr>
<th>Person 1</th>
<th>Person 2</th>
<th>Person 3</th>
</tr>
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table>
Let the first row be table header cells:
Example
87
HTML Table Tags
Tag | Description |
|---|---|
Defines a table | |
Defines a header cell in a table | |
Defines a row in a table | |
Defines a cell in a table | |
Defines a table caption | |
Specifies a group of one or more columns in a table for formatting | |
Specifies column properties for each column within a <colgroup> element | |
Groups the header content in a table | |
Groups the body content in a table | |
| |
88
Multiple Choice
What is the correct tag name for a table-cell in HTML?
<tc>
<td>
<tr>
89
Multiple Choice
What is the correct tag name for a table-row in HTML?
<tr>
<td>
<th>
90
Multiple Choice
What is the correct tag name for a table-row in HTML?
<tr>
<td>
<th>
91
Open Ended
Add a table row at the end of the table, with two table cells.
The two table cells should have the value "Eve Jackson" and "94".
92
HTML Table Padding & Spacing
HTML tables can adjust the padding inside the cells, and also the space between the cells.
93
HTML Table - Cell Padding
Cell padding is the space between the cell edges and the cell content.
By default the padding is set to 0.
To add padding on table cells, use the CSS padding property:
Example
th, td {
padding: 15px;
}
94
HTML Table - Cell Padding
To add padding only above the content, use the padding-top property.
Add padding to the other sides with the padding-bottom, padding-left, and padding-right properties:
Example
th, td {
padding-top: 10px;
padding-bottom: 20px;
padding-left: 30px;
padding-right: 40px;
}
95
HTML Table - Cell Spacing
Cell spacing is the space between each cell.
By default the space is set to 2 pixels.
To change the space between table cells, use the CSS border-spacing property on the table element:
Example
table {
border-spacing: 30px;
}
96
Multiple Choice
What is the correct CSS property for styling the padding inside table cells?
padding
table-padding
cell-padding
97
Multiple Choice
What is the correct CSS property for styling the space between the table cells?
spacing
table-spacing
border-spacing
98
Fill in the Blank
.table td { ___________ : 15px; }
99
HTML Table Colspan & Rowspan
HTML tables can have cells that span over multiple rows and/or columns.
100
HTML Table - Colspan
To make a cell span over multiple columns, use the colspan attribute:
Example
<table>
<tr>
<th colspan="2">Name</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>43</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>57</td>
</tr>
</table>
101
HTML Table - Rowspan
To make a cell span over multiple rows, use the rowspan attribute:
Example
<table>
<tr>
<th>Name</th>
<td>Jill</td>
</tr>
<tr>
<th rowspan="2">Phone</th>
<td>555-1234</td>
</tr>
<tr>
<td>555-8745</td>
</tr>
</table>
102
HTML Table - Rowspan
To make a cell span over multiple rows, use the rowspan attribute:
Example
<table>
<tr>
<th>Name</th>
<td>Jill</td>
</tr>
<tr>
<th rowspan="2">Phone</th>
<td>555-1234</td>
</tr>
<tr>
<td>555-8745</td>
</tr>
</table>
103
104
Multiple Choice
What is the correct HTML attribute for specifying how many rows a cell should span?
span
rowspan
spanning
105
Multiple Choice
What is the standard file format for favicons?
.png
.ico
.jpg
All of the above
106
Multiple Choice
Which attribute specifies the favicon file path in ?
href
src
link
file
107
Multiple Choice
What does this code do:
Adds a page title
Adds a favicon
Creates a table
Sets a background
108
Multiple Choice
Which rel attribute is used for a favicon?
stylesheet
icon
shortcut
favicon
109
Multiple Choice
Can a favicon be in .png format?
Yes
No
Only .ico
Only .jpg
110
Multiple Choice
Which HTML section must the for favicon appear?
111
Multiple Choice
What happens if no favicon is specified?
browser displays default icon
page will not load
html shows an error
browser shows blank
112
Multiple Choice
Which of these is a valid favicon path?
images/favicon.ico
favicon.ico
Both A and B
None
113
Multiple Choice
What does this code do:
adds a favicon for older browsers
adds a page title
creates a table
sets background color
114
Multiple Choice
Why is it recommended to have multiple favicon sizes?
for seo purposes
for responsive display
to load faster
to add animation
115
Multiple Choice
Which size is commonly used for a favicon?
16x16 pixels
32x32 pixels
48x48 pixels
All of the above
116
Multiple Choice
A website's favicon doesn’t appear. What might be the reason?
Wrong file path
Wrong rel attribute
Browser cache
All of the above
117
Multiple Choice
A company wants the same favicon on all pages. What is the best practice?
Include on every page
Include favicon in CSS
Include favicon only on homepage
None of the above
118
Multiple Choice
You need a transparent favicon. Which format should you choose?
.ico
.png
.jpg
.gif
119
Multiple Choice
Favicon works in Chrome but not Safari. What is likely the issue?
File format compatibility
Missing in
to support faviconBoth A and B
Browser does not support favicon
120
Multiple Choice
To ensure favicons load on all devices, what should a developer do?
Use multiple sizes and formats
Only use .ico format
Only use .png format
Only include on homepage
121
Multiple Choice
What does the page title appear as in a browser?
Browser tab text
Webpage content
Footer
Favicon
122
Multiple Choice
Can a page title include special characters?
Yes
No
Only letters
Only numbers
123
Multiple Choice
Is it possible to have multiple
Yes
No
Only in HTML5
Only in
124
Multiple Choice
Which of the following is a valid title?
Both A and B
125
Multiple Choice
What happens if
Browser shows URL as tab text
Browser shows blank tab
Browser displays an error
Browser uses favicon
126
Multiple Choice
Which is the correct HTML5 syntax for title?
127
Multiple Choice
Can the page title affect SEO ranking?
yes
no
only headings affect SEO
only images affect SEO
128
Multiple Choice
What is the recommended length for a page title?
30–60 characters
10–20 characters
100+ characters
Only 5–10 characters
129
Multiple Choice
Which page title is better for SEO?
Home
HTML Tutorial – Learn Web Dev
Page 1
Untitled
130
Multiple Choice
How do you include a page title for multiple pages of the same site?
Use unique
use same
use tag instead
use CSS
131
Multiple Choice
What does
browser tab text display
SEO ranking
webpage content
search engine snippet
132
Multiple Choice
Can JavaScript dynamically change the page title?
yes
no
only in
only with CSS
133
Multiple Choice
Why should page titles be descriptive?
to attract clicks from search engines
to improve page design
to create tables
to increase favicon size
134
Multiple Choice
Which is a correct way to combine title with dynamic content in JavaScript?
document.title = "Home – " + username;
title.document =
document.head.title("Home")
135
Multiple Choice
A blog site has multiple articles. Which title format is the best?
Article Title – Blog Name
Blog Name – Article Title
only Blog Name
only Article Title
136
Multiple Choice
A developer wants the title to change based on user login. Which method should be used?
JavaScript document.title
CSS title property
HTML
137
Multiple Choice
The homepage of an e-commerce site is missing a title. What is likely the impact?
SEO ranking decreases
Users may have difficulty navigating tabs
Browser shows URL as tab text
All of the above
138
Multiple Choice
A website uses same title for all pages. What could be the problem?
Poor SEO
Confusing browser tabs
Both A and B
No problem
139
Multiple Choice
Which attribute sets the border thickness of a table?
border
style
cellpadding
cellspacing
140
Multiple Choice
What does colspan="2" do?
Merge two rows
Merge two columns
Add two columns
Add two rows
141
Multiple Choice
What does rowspan="3" do?
Merge three columns
Merge three rows
Add three columns
Add three rows
142
Multiple Choice
How does the use of meta descriptions impact SEO?
They are only for social media sharing
They have no effect
They improve click-through rates
They only affect mobile SEO
143
Multiple Choice
What is the purpose of the tag?
To add a favicon
To set the page title
To define the character encoding
To link to stylesheets
144
Multiple Choice
What happens if a page title is too long?
It causes a loading error
It improves SEO
It has no effect
It gets truncated in search results
145
Multiple Choice
What is the purpose of the tag?
To link external stylesheets
To add a favicon
To control layout on mobile browsers
To set the character encoding
146
Multiple Choice
How can you specify a fallback for older browsers that do not support ?
There is no fallback
Use a