Lecture

body Tag

The <body> tag contains the actual contents displayed on a web page.

All web content that interacts with users should be located inside the body tag.

The following elements can be included within the <body> tag:


Text Elements

Tags used to display text content on a webpage.

  • <h1>, <h2> ... <h6>: 'h' stands for Heading, representing headings ranging from the largest (h1) to the smallest (h6).

  • <p>: A tag that represents a paragraph of text.

Displaying Headings and Paragraphs
<body> <h1>Welcome!</h1> <p>This is my first webpage.</p> </body>

Images, Videos, Audio

The following tags are used to display multimedia content on a webpage.

  • <img>: A tag to display images

  • <video>: A tag to display videos

  • <audio>: A tag to display audio

img, video, audio Tags
<body> <img src="myimage.jpg" alt="My Photo" /> <video src="myvideo.mp4" controls></video> <audio src="mysong.mp3" controls></audio> </body>

Lists

Display ordered or unordered lists on a webpage.

  • <ul>: Unordered List

  • <ol>: Ordered List

  • <li>: List Item

ul, li Tags
<body> <!-- Unordered List --> <ul> <li>Apple</li> <li>Banana</li> </ul> </body>

Links

  • <a>: Creates a hyperlink that allows navigating to other pages or websites.
a Tag
<body> <a href="https://www.example.com">Go to example.com</a> </body>

Practice

Follow and type the highlighted parts of the code.

Lecture

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help