Student: Majharul Islam | ID: 232002256 | Date: October 2025
The HTML head section contains metadata about the document, including title, character encoding, viewport settings, stylesheets, scripts, and other information that is not displayed directly on the page.
| Element | Purpose | Description |
|---|---|---|
| <title> | Page Title | Sets the browser tab title |
| <meta> | Metadata | Provides document metadata |
| <link> | External Resources | Links to external files |
| <style> | CSS Styles | Embedded CSS styles |
| <script> | JavaScript | Embedded or linked JavaScript |
| <base> | Base URL | Sets base URL for relative links |
| <noscript> | No Script Fallback | Content for non-JavaScript browsers |
<title>Web Programming Lab - HTML Documentation</title>
The title element is displayed in the browser tab and is important for SEO and bookmarking.
<!-- Homepage -->
<title>Green University of Bangladesh - CSE Department</title>
<!-- Course Page -->
<title>Web Programming Lab - HTML Basics | GUB CSE</title>
<!-- Article -->
<title>Complete HTML Reference Guide - Web Development Tutorial</title>
<!-- Contact Page -->
<title>Contact Us - Green University CSE Department</title>
<meta charset="UTF-8">
Purpose: Specifies character encoding
Required: Should be first meta tag
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
Purpose: Controls mobile viewport
Required: For responsive design
<meta name="description"
content="Complete HTML documentation for web programming lab">
Purpose: Page description for search engines
SEO: Important for search rankings
<meta name="keywords"
content="HTML, CSS, JavaScript, web development, tutorial">
Purpose: Keywords for search engines
Note: Less important for modern SEO
<meta name="author"
content="Majharul Islam">
Purpose: Identifies page author
Use: For documentation and blogs
<meta name="robots"
content="index, follow">
Purpose: Controls search engine crawling
Options: index/noindex, follow/nofollow
<!-- Open Graph for Social Media -->
<meta property="og:title" content="HTML Documentation">
<meta property="og:description" content="Complete HTML reference guide">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:url" content="https://example.com/html-docs">
<meta property="og:type" content="website">
<!-- Twitter Cards -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="HTML Documentation">
<meta name="twitter:description" content="Complete HTML reference guide">
<meta name="twitter:image" content="https://example.com/image.jpg">
<!-- Theme Color -->
<meta name="theme-color" content="#3498db">
<!-- Refresh -->
<meta http-equiv="refresh" content="30">
<!-- Cache Control -->
<meta http-equiv="cache-control" content="no-cache">
<link rel="stylesheet"
href="styles.css">
Purpose: Links external CSS file
Common: Most used link type
<link rel="icon"
type="image/x-icon"
href="/favicon.ico">
Purpose: Sets browser tab icon
Formats: .ico, .png, .svg
<link rel="preconnect"
href="https://fonts.googleapis.com">
Purpose: Establishes connection early
Performance: Improves loading speed
<link rel="dns-prefetch"
href="//fonts.googleapis.com">
Purpose: Resolves DNS early
Performance: Faster external resource loading
<link rel="canonical"
href="https://example.com/page">
Purpose: Prevents duplicate content issues
SEO: Important for search engines
<link rel="alternate"
hreflang="bn"
href="https://example.com/bn/">
Purpose: Indicates alternative language versions
SEO: Helps with international SEO
<!-- CSS Stylesheets -->
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="responsive.css" media="(max-width: 768px)">
<link rel="stylesheet" href="print.css" media="print">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<!-- Favicons -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<!-- Manifest -->
<link rel="manifest" href="/site.webmanifest">
<style>
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
}
h1 {
color: #333;
text-align: center;
margin-bottom: 30px;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
</style>
<style>
/* Default styles */
.sidebar {
width: 300px;
float: left;
}
/* Print styles */
@media print {
.sidebar {
display: none;
}
body {
font-size: 12pt;
line-height: 1.4;
}
}
/* Mobile styles */
@media (max-width: 768px) {
.sidebar {
width: 100%;
float: none;
margin-bottom: 20px;
}
}
</style>
<script src="script.js"></script>
Purpose: Links external JavaScript file
Loading: Blocks HTML parsing by default
<script>
console.log('Hello World!');
document.addEventListener('DOMContentLoaded', function() {
// Code here
});
</script>
Purpose: Embeds JavaScript code
Use: Small scripts or configuration
<script src="script.js"
async></script>
Purpose: Loads script asynchronously
Performance: Doesn't block HTML parsing
<script src="script.js"
defer></script>
Purpose: Defers script execution
Execution: Runs after HTML parsing
<!-- Critical JavaScript (inline) -->
<script>
// Critical functionality that must run immediately
window.APP_CONFIG = {
apiUrl: 'https://api.example.com',
version: '1.0.0'
};
</script>
<!-- Non-critical JavaScript (async) -->
<script src="analytics.js" async></script>
<script src="chat-widget.js" async></script>
<!-- Main application script (defer) -->
<script src="app.js" defer></script>
<!-- Module script -->
<script type="module" src="main.js"></script>
<base href="https://example.com/docs/">
<base target="_blank">
The base element sets the base URL for all relative URLs in the document.
<noscript>
<p>This website requires JavaScript to function properly.
Please enable JavaScript in your browser settings.</p>
<p>Alternatively, you can <a href="/static-version/">view the static version</a>.</p>
</noscript>
<style>
.dynamic-content {
display: block;
}
</style>
<noscript>
<style>
.dynamic-content {
display: none;
}
.static-fallback {
display: block;
}
</style>
</noscript>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Character Encoding -->
<meta charset="UTF-8">
<!-- Viewport for Responsive Design -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Page Title -->
<title>HTML Documentation - Web Programming Lab | Green University</title>
<!-- Meta Description -->
<meta name="description" content="Complete HTML documentation for web programming lab students. Learn HTML basics, elements, attributes, and advanced techniques.">
<!-- Meta Keywords -->
<meta name="keywords" content="HTML, CSS, JavaScript, web development, tutorial, documentation, programming">
<!-- Author Information -->
<meta name="author" content="Majharul Islam">
<!-- Robots Directive -->
<meta name="robots" content="index, follow">
<!-- Theme Color -->
<meta name="theme-color" content="#3498db">
<!-- Open Graph Meta Tags -->
<meta property="og:title" content="HTML Documentation - Web Programming Lab">
<meta property="og:description" content="Complete HTML reference guide for students">
<meta property="og:type" content="website">
<meta property="og:url" content="https://example.com/html-docs">
<meta property="og:image" content="https://example.com/og-image.jpg">
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="HTML Documentation">
<meta name="twitter:description" content="Complete HTML reference guide">
<meta name="twitter:image" content="https://example.com/twitter-image.jpg">
<!-- Favicons -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<!-- CSS Stylesheets -->
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="responsive.css" media="(max-width: 768px)">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<!-- Canonical URL -->
<link rel="canonical" href="https://example.com/html-docs">
<!-- Critical CSS (inline) -->
<style>
body {
font-family: 'Roboto', sans-serif;
margin: 0;
padding: 0;
line-height: 1.6;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
<!-- Critical JavaScript (inline) -->
<script>
// Critical functionality
window.APP_CONFIG = {
version: '1.0.0',
apiUrl: 'https://api.example.com'
};
</script>
<!-- Non-critical JavaScript (async) -->
<script src="analytics.js" async></script>
<!-- Main application script (defer) -->
<script src="app.js" defer></script>
</head>