![]() |
The HTML <head> element acts as a container for crucial metadata that defines the document’s essential attributes. Positioned between the <html> and <body> tags, elements such as <title>, <style>, <meta>, <link>, <script>, and <base> are wrapped inside The HTML <head> element. Additionally, The information contained by the <head> element is not displayed by the browser on the web page. HTML head Elements
Table of Content HTML <title> ElementThe title tag is an important element of a webpage that is used to provide the title of the page. It should contain only text and there can only be one <title> element in an HTML document. To make your webpage more informative, it is advisable to use a detailed and descriptive title instead of a short one. Example: Implementation of title tag. HTML
Output: HTML <style> ElementThe HTML <style> element is used to embed or link to CSS styles within a webpage, allowing developers to define the visual presentation of HTML elements. It enhances the design and layout of a document by specifying color, font, spacing, and other styling properties. Example: Implementation of style element with inline styling and style tag. HTML
Output: HTML <link> ElementThe <link> tag in HTML is used to define a link between a document and an external resource. The link tag is mainly used to link to external style sheets making an organised structure of CSS files. Example: Implementation of link element. HTML
CSS
Output: HTML <meta> ElementThe HTML <meta> element provides metadata about an HTML document, conveying information like character encoding, viewport settings for responsiveness, and other essential details. It contributes to proper rendering and search engine optimization without being visibly displayed on the webpage.
<meta charset="UTF-8">`:
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="description" content="Free Web tutorials">
<meta name="author" content="John Doe">
<meta http-equiv="refresh" content="60">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> Example: The implementation of meta tag. HTML
Output: Setting the viewportThe viewport is the visible area of a web page for the user. It differs based on the device, smaller on mobiles and larger on computers. Include the <meta> element below on all pages: <meta name="viewport" content="width=device-width, initial-scale=1.0"> This instructs the browser on how to manage page dimensions and scaling. ‘width=device-width’ adapts the page width to the device screen, and ‘initial-scale=1.0’ sets the initial zoom level when the page loads. HTML <script> ElementThe HTML <script> element is used to embed or reference JavaScript code within an HTML document. It allows developers to add interactivity, dynamic behavior, and functionality to web pages by executing scripts written in JavaScript. Example: Implementation of the script element. HTML
Output: HTML <base> ElementThe HTML <base> element sets the base URL for all relative URLs within a webpage. It helps define a starting point for resolving relative links, making it useful for establishing a consistent reference point for resources like images, stylesheets, and links. Example: Implementation of base the element HTML
Output: |
Reffered: https://www.geeksforgeeks.org
HTML |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 16 |