Metadata, script links, stylesheet links, and other connections that take readers out of the immediate view of the webpage are all contained in the <head> section of an HTML document. Setting up the document's details and adding links to outside resources that alter the way the website looks and functions are essential tasks for this phase.
Key Elements Inside <head>:
Example of a <head> section:
<head> <title>My Sample Website</title> <meta charset="UTF-8"> <meta name="description" content="Free Web tutorials"> <meta name="keywords" content="HTML, CSS, JavaScript"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <script src="script.js"></script> </head> |
Metadata, script links, stylesheet links, and other connections that take readers out of the immediate view of the webpage are all contained in the <head> section of an HTML document. Setting up the document's details and adding links to outside resources that alter the way the website looks and functions are essential tasks for this phase.
Key Elements Inside <head>:
Example of a <head> section:
<head> <title>My Sample Website</title> <meta charset="UTF-8"> <meta name="description" content="Free Web tutorials"> <meta name="keywords" content="HTML, CSS, JavaScript"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <script src="script.js"></script> </head> |
Use the <link> tag inside the <head> to attach an external CSS file.
Comments in HTML are written between <!-- and -->.
HTML entities are used to display reserved or special characters.
The <iframe> tag embeds another webpage within the current page.
The id attribute uniquely identifies a single HTML element.
Hyperlinks are created using the <a> tag with an href attribute.
Use the <img> tag and specify the image source with the src attribute.
Use the target="_blank" attribute inside the <a> tag.
Copyrights © 2024 letsupdateskills All rights reserved