materi & tugas pkl h19 part2 html (5-2-2024)

 



HTML



HTML Favicon

A favicon is a small image displayed next to the page title in the browser tab.


How To Add a Favicon in HTML

You can use any image you like as your favicon.

A favicon image is displayed to the left of the page title in the browser tab


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 <link> element to your "index.html" file, after the <title> element, like this:


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>

Now, save the "index.html" file and reload it in your browser. Your browser tab should now display your favicon image to the left of the page title.




HTML Page Title

Every web page should have a page title to describe the meaning of the page.

The <title> element adds a title to your page:


Example

<!DOCTYPE html>

<html>

<head>

  <title>HTML Tutorial</title>

</head>

<body>

The content of the document...

</body>

</html>


The title is shown in the browser's title bar

The title should describe the content and the meaning of the page.

The page title is very important for search engine optimization (SEO). The text is used by search engine algorithms to decide the order when listing pages in search results.


The <title> element:

-defines a title in the browser toolbar

-provides a title for the page when it is added to favorites

-displays a title for the page in search engine-results

LihatTutupKomentar