Links and Images
Links use the <a> element. The href attribute holds the address. An attribute is extra information written inside the opening tag.
<a href="https://terixto.com">Visit Terixto</a>Links are what make the web a web: they connect pages to each other, across the whole world. The clickable text between the tags should describe where the link goes - "Read our delivery policy" is much better than "click here", both for visitors and for search engines.
An address can be absolute (a full web address starting with https://) for other websites, or relative (like about.html) for pages on your own site. Links can also point to an email (mailto:), a phone number (tel:), or a section of the same page (#contact).
Images use <img>, an empty element. src is the image address and alt is a text description, shown if the image cannot load and read aloud by screen readers.
Images make pages attractive and help explain things, but they're also the heaviest part of most pages. Use the right size (don't load a 4000-pixel photo for a small thumbnail) and modern formats like WebP so pages load fast on mobile data. The alt text matters: blind visitors hear it, and it shows when the image fails to load.
<!DOCTYPE html>
<html>
<body>
<h2>Links and images</h2>
<p><a href="https://terixto.com" target="_blank">Open Terixto in a new tab</a></p>
<img src="https://terixto.com/logo-mark.png?v=3" alt="Terixto logo" width="120">
<p>If the image fails to load, the alt text appears instead.</p>
</body>
</html>▶ Try it yourselftarget="_blank"opens a link in a new tab.- Always write meaningful
alttext, such as "Red cotton kurta", not "image1". - Set
widthorheightso the page does not jump while the image loads.
- Links:
<a href="...">text</a>; describe the destination in the text. - Images:
<img src="..." alt="...">; always write useful alt text. - Attributes add extra information inside the opening tag.
