Thuta Learning
BasicWeb Developmentbeginner

Attributes

Relax. We'll talk through this in plain words — no textbook voice.

Attributes are like settings that give an element extra information. The format is name="value", written inside the start tag.

  • href — the address the link goes to
  • src — the source file for an image/video/audio
  • alt — text shown if the image fails to load, and important for accessibility
  • class / id — little name tags for hooking into CSS/JavaScript
html
<a href="https://www.google.com" target="_blank">Go to Google</a>
<img src="image.jpg" alt="A peaceful mountain" width="300">
<p class="highlight" id="intro-text">This paragraph can be styled later.</p>
You should see
The browser should be able to read a paragraph containing a link, an image, and a class/id.
Attributes | Thuta Learning