Basic HTML
Images and Multimedia Content
Image Tag (<img>
) and Attributes (src, alt, title, width, height)
The <img>
tag is used to insert images into a web page. It is a self-closing tag and requires the src
attribute to specify the image path. Other important attributes include alt
for alternative text, title
for additional information, and width
and height
to define the size.
html
Image Formats (JPEG, PNG, GIF, SVG, etc.)
Each image format has its own characteristics:
- JPEG: Ideal for photographs. It has lossy compression, which reduces quality as it compresses.
- PNG: Supports transparency and is lossless, suitable for graphics with transparent areas.
- GIF: Allows animations but has a limited color palette.
- SVG: Is vector-based, meaning it scales without losing quality. Perfect for icons and logos.
Visual examples of different image formats, showing their features
Audio and Video Elements (<audio>
, <video>
)
HTML5 allows embedding audio and video directly in the web page through the <audio>
and <video>
tags. Both elements require the src
attribute and can include other attributes like controls
to allow users to play, pause, or adjust the volume.
Audio Example
html
Video Example
html
Embedding Videos from Other Platforms
We can embed videos from external platforms like YouTube using the <iframe>
tag. We only need the video URL to display it directly on our page.
html
Chapter Conclusion
You now know how to include images, audio, and video in your HTML pages, adding a visual and multimedia layer to your content. In the next chapter, we'll explore how to create tables to organize data in a structured manner.
- Introduction to HTML
- Text Elements in HTML
- Lists in HTML
- Links and Navigation
- Images and Multimedia Content
- Tables in HTML
- Forms in HTML
- HTML Head and Metadata
- Semantic HTML
- HTML5 APIs and Advanced Elements
- iFrames and HTML Embeddings
- Data Representation with HTML
- Accessibility in HTML
- Best Practices for HTML
- HTML and SEO
- HTML for Responsive and Mobile Design
- Integration of HTML with JavaScript
- Creating a Simple Website