The Body Element
The <body> element contains all the visible content of your webpage - everything users see and interact with.
The Body Element
The <body> element:
- Contains all visible page content
- Should only appear once per document
- Comes after the closing
</head>tag - Is closed just before
</html>
Content Types in Body
The body can contain many types of content:
Common body content:
- Headings (
<h1>-<h6>) - Paragraphs (
<p>) - Lists (
<ul>,<ol>,<li>) - Links (
<a>) - Images (
<img>) - Divisions (
<div>) - Semantic elements (
<header>,<main>,<footer>)
Block vs Inline Elements
Elements in the body are either block-level or inline:
Block elements:
- Start on a new line
- Take up full width available
- Examples:
<div>,<p>,<h1>,<ul>,<section>
Inline elements:
- Stay on the same line
- Only take up as much width as needed
- Examples:
<span>,<a>,<strong>,<em>,<img>
Basic Page Layout
A typical page structure in the body:
Exercise: Create Page Content
Create a complete body with a heading, two paragraphs, and a link:
The body is where all the magic happens - it's the canvas for your web content!
التالي · الدرس 5 من 32
Headings (h1-h6)
قراءة 2 دقيقة
أنهيت 4 من 32 درسًا

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

