Skip to content
Chapter 2 — Text formatting, Links & Images
- Text formatting tags:
<strong> (important/bold), <em> (emphasis/italic)
<mark> (highlight), <small>, <del> (deleted), <ins> (inserted)
- Hyperlinks (links):
<a href="https://example.com">Visit site</a> <a href="#section1">Jump to section</a> <!-- internal link --> <a href="mailto:me@example.com">Email me</a>
target="_blank" opens in new tab; rel="noopener" recommended for safety.
- Images:
<img src="image.jpg" alt="description" width="300">
alt text is essential for accessibility and SEO.
- Use proper formats (JPEG for photos, PNG for transparency, SVG for scalable icons).
- Inline vs block elements:
- Inline (e.g.,
<a>, <img>) do not start on a new line.
- Block (e.g.,
<p>, <div>, headings) start on a new line and can contain other elements.
- File paths: relative vs absolute (use relative for local site links).