The Head Element

The <head> element in HTML is used to contain meta-information about the HTML document. This includes elements like the page title, links to stylesheets, character set declarations, and more. 

Common Element in the <head>:

  • <title>: Sets the title of the webpage.
  • <meta>: Provides metadata about the HTML document (like character encoding, author, and keywords).
  • <link>: Links external resources like stylesheets and icons.
  • <style>: Embeds CSS styles directly within the HTML document.
  • <script>: Embeds or links to JavaScript code.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"> <!-- Specifies the character encoding for the document -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Ensures proper scaling on mobile devices -->
<meta name="description" content="A brief description of your page"> <!-- Describes the content of your page -->
<meta name="keywords" content="HTML, CSS, JavaScript"> <!-- Keywords related to your page -->
<meta name="author" content="Your Name"> <!-- The author of the document -->
<title>Your Page Title</title> <!-- The title displayed in the browser tab -->
<link rel="stylesheet" href="styles.css"> <!-- Links to an external stylesheet -->
<link rel="icon" href="favicon.ico"> <!-- Adds a favicon for your page -->

<script src="script.js"></script> <!-- Links to an external Javascript -->
<!-- Any additional meta tags, scripts, or links go here -->
</head>
<body>
<!-- Your content goes here -->
</body>
</html>

Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.