Custom Icons
One common use of the <head>
element is to include icons that represent the page or website. To add a custom icon to an HTML website, you can use the <link>
tag in your HTML document's <head>
section. The <link>
tag should include the rel
attribute, which specifies that the link is an icon, and the href
attribute, which specifies the URL of the icon.
index.html
9
1
2
3
4
5
6
7
<!DOCTYPE html>
<html>
<head>
<link rel="icon" href="https://www.example.com/favicon.ico" />
</head>
<body></body>
</html>
Additionally, you can specify different icons for different devices and screen resolutions by using the sizes and type attributes.
index.html
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<html>
<head>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="https://www.example.com/favicon-16x16.png" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="https://www.example.com/favicon-32x32.png" />
<link
rel="icon"
type="image/png"
sizes="96x96"
href="https://www.example.com/favicon-96x96.png" />
</head>
<body></body>
</html>
1. What element is used to define the title of a webpage, and is typically placed within the <head>
element?
2. Can the <head>
element be used more than once in an HTML document?
3. What type of information can be included in the <head>
element?
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 3
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат