-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics
<head>
in HTML?The <head>
tag is a container for metadata and is placed before the <body>
tag. It holds information about the web page such as title, character set, styles, scripts, and more. Content inside <head>
does not appear visually on the web page.
<!DOCTYPE html>
<html>
<head>
<!-- Metadata goes here -->
</head>
<body>
<!-- Page content goes here -->
</body>
</html>
<head>
Tag | Purpose |
---|---|
<title> |
Sets the title in browser tab |
<meta> |
Provides metadata like description, author, charset |
<link> |
Links external resources like CSS or favicon |
<style> |
Adds internal CSS |
<script> |
Adds or links JavaScript |
<base> |
Sets a base URL for all relative URLs in the document |
<title>
– Sets the page title<title>My Awesome Website</title>
<meta>
– Adds metadata<meta charset="UTF-8">
<meta name="description" content="A beginner’s guide to HTML">
<meta name="author" content="John Doe">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link>
– Links external resources (e.g., CSS, favicon)<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<style>
– Internal CSS<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
</style>
<script>
– JavaScript<script>
console.log("Welcome to my website!");
</script>
Or external:
<script src="script.js"></script>
Q1. Add a <title>
tag to your HTML document.
Q2. Include a <meta>
tag to set UTF-8 character encoding.
Q3. Write a <meta>
tag with a page description.
Q4. Link a CSS file called main.css
using <link>
.
Q5. Use <style>
inside the <head>
to change body text color.
Q6. Insert JavaScript code using <script>
to display an alert.
Q7. Set a favicon with <link rel="icon">
.
Q8. Use <meta name="viewport">
for responsive design.
Q9. Create a <head>
section with all standard tags.
Q10. Add a <base>
tag to set the base URL for your links.
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics