Tag | Purpose |
---|---|
<h1> –<h6> |
Headings, from highest (<h1> ) to lowest (<h6> ) |
<p> |
Paragraph |
<strong> |
Strong importance (semantic bold) |
<em> |
Emphasized text (semantic italic) |
<br> |
Line break (no closing tag) |
<blockquote> |
Quoted block of text |
<mark> |
Highlighted text |
<abbr> |
Abbreviation with tooltip on hover |
<a> |
Hyperlink |
<a>
AttributesAttribute | Purpose | Example |
---|---|---|
href |
Destination URL (absolute or relative) | <a href="/about">About</a> |
target="_blank" |
Opens link in a new tab | <a href="<https://example.com>" target="_blank">Visit</a> |
rel |
Defines relationship between current and linked doc | rel="noopener noreferrer" when using _blank |
download |
Prompts file download instead of navigation | <a href="/file.pdf" download>PDF</a> |
title |
Tooltip shown on hover | <a title="More info">Hover me</a> |
type |
MIME type of linked resource | <a href="file.pdf" type="application/pdf">PDF</a> |
Tag | Purpose |
---|---|
<img> |
Embeds an image |
<video> |
Embeds video content |
<audio> |
Embeds audio content |
<img>
Attributessrc
: Image URLalt
: Description for screen readers<video>
/ <audio>
Attributescontrols
: Enables play/pause UIsource
: Preferred media format (.mp4
, .mp3
, etc.)<img src="image.jpg" alt="Description">
<video controls>
<source src="video.mp4" type="video/mp4">
</video>
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
</audio>