Images and Links
Inserting Images
<img src="image.jpg" alt="Image description" width="300">
src: Path to the image file.alt: Alternative text for accessibility and SEO.widthandheight: Define the size of the image.
Creating Links
<a href="https://www.example.com">Visit website</a>
href: The address the link points to.
Internal Links
<a href="#section1">Go to Section 1</a>
Best Practices
- Always include the
altattribute for images. - Use relative paths for internal resources.
Exercise
Create an HTML document that displays an image with a link that directs to an external website.