Media Elements

Level : Intermediate
Mentor: Shailendra Chauhan
Duration : 00:00:50

Image Element (img):

The image element is used to embed images into an HTML document.

Example:

<img src="image.jpg" alt="Description of the image">

Video Element (video):

The video element is used to embed videos into a webpage.

Example:

<video controls>
  <source src="video.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

Hyperlinks and Anchors:

Hyperlinks, created using the anchor element (`<a>`), allow users to navigate to other web pages or resources.

Example:

<a href="https://www.example.com">Visit Example Website</a>

Unique ID Attributes:

The ID attribute provides a unique identifier for an HTML element. It is used for targeting elements with CSS or JavaScript.

Example:

<div id="myDiv">Content goes here</div>

Target Attribute:

The target attribute is used with anchor elements to specify where the linked content will be displayed when clicked.

Example:

<a href="https://www.example.com" target="_blank">Open in a new tab</a>

Linking to Different Parts of the Page:

Linking within the same page is achieved using anchor elements with the appropriate ID attribute.

Example:

<a href="#section2">Jump to Section 2</a>
<h2 id="section2">Section 2</h2>

File Paths in HTML:

File paths are used to link external resources, such as CSS files, images, and scripts.

Example:

<img src="images/picture.jpg" alt="Image">
<link rel="stylesheet" href="styles/main.css">

HTML Family Tree Structure:

HTML elements are arranged in a hierarchical family tree structure, with parent-child relationships.

Example:

<div>
  <p>This is a child paragraph.</p>
</div>
Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 125+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this