reading-notes

Using Images In HTML

alt attribute

A real-world use case for the alt attribute shown in the sources is providing a text description for a complex image, such as a “Diagram showing the data channels,” so the information remains available if the image cannot be displayed.

Improve Accessibility

To improve accessibility of images in an HTML document, you can:

<figure> element

The <figure> element is your go-to tool whenever you have a piece of content that is self-contained but referenced by the main text. Think of it as a container for information that could be moved to an appendix or a different page without losing its meaning, but is currently placed right where it is for better flow.

gif vs svg

To explain the difference between a GIF and an SVG to an elder:

Screenshot image type

For a screenshot, you should use PNG or lossless WebP. You should choose these lossless formats because screenshots often contain text; if you use a “lossy” format that throws away data to save space, that text can become fuzzy and hard to read.

Color and Styling

Difference between foreground and background colors

Think of the foreground as the actual “ink” used to write the words or draw shapes, while the background is the “paper” or surface those words are sitting on. In a website, the foreground color usually refers to the text itself, and the background color is the shade filling the space behind that text.

Use color to add character

If I were giving a friend’s blog some character using color, I would suggest several creative touches based on the sources:

Consider when **choosing fonts for an HTML document**

font-size, font-weight, and font-style properties

Two ways you could add spacing around characters

  1. letter-spacing: This allows you to increase or decrease the space between every individual letter in the heading.
  2. word-spacing: This adjusts the amount of space between the actual words in the heading.