The Head Element
The <head> element contains metadata about the document - information that isn't displayed directly on the page but is crucial for browsers, search engines, and other services.
What Goes in the Head?
Common elements in the <head>:
<title>- The page title (shows in browser tab)<meta>- Metadata about the document<link>- Links to external resources (CSS, icons)<style>- Internal CSS styles<script>- JavaScript code or references
The Title Element
The <title> is required and appears in:
- Browser tab
- Bookmarks
- Search engine results
Best practices for titles:
- Keep them under 60 characters
- Include relevant keywords
- Use format: "Page Name | Site Name"
Meta Elements
Meta elements provide metadata about the HTML document:
Essential meta tags:
- charset="UTF-8" - Character encoding (supports all characters)
- viewport - Controls how page displays on mobile devices
- description - Summary for search engines (150-160 characters)
Link Element
The <link> element connects external resources:
<head>
<!-- External stylesheet -->
<link rel="stylesheet" href="styles.css">
<!-- Favicon (browser tab icon) -->
<link rel="icon" href="favicon.ico">
<!-- Preload important resources -->
<link rel="preload" href="font.woff2" as="font">
</head>
Exercise: Build a Complete Head
Create a proper <head> section with title, charset, viewport, and description:
A well-structured head section helps with SEO, accessibility, and proper rendering across devices!
التالي · الدرس 4 من 32
The Body Element
قراءة 2 دقيقة
أنهيت 3 من 32 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

