Lazy Loading Images and Why It Matters
One attribute defers images until they are needed, and applying it to every image on the page is a reliable way to make the page feel slower.
HTML is the easiest of these languages to write badly and still have something appear on screen, which is exactly why it is worth learning properly. These tutorials start from what a tag actually is and build up to markup that is readable, accessible and does not fall apart when you add CSS to it.
One attribute defers images until they are needed, and applying it to every image on the page is a reliable way to make the page feel slower.
For years the advice was to leave dimensions out of the markup. That advice reversed, and the reason is a metric that affects both users and rankings.
SVG can be embedded three ways and the choice is not cosmetic. Only one of them lets CSS reach inside the graphic.
The rule is simple and often ignored. If the image carries information it goes in the markup, and if it is decoration it goes in the stylesheet.
Video plays natively in every browser with no plugin. The attributes are simple, and one of them will silently refuse to work unless paired with another.
The audio element is the simpler sibling of video and follows the same rules. The most valuable thing you can add to it is not a player feature at all.
Captions and subtitles are not the same thing, and the track element distinguishes them. The file format behind both is plain text you can write by hand.
An embed is somebody else's page inside yours, with all the weight and tracking that implies. Four attributes make one behave considerably better.
Images are usually the largest thing on a page. Most of the saving comes from one step that has nothing to do with compression settings.
A form is the oldest interactive feature in HTML and works entirely without JavaScript. Understanding what submission actually does explains most form problems.
The choice between the two methods is not about size or preference. It comes down to whether the request reads something or changes something.
The type attribute changes the keyboard on a phone, the validation applied, and the interface offered. Two of the types are best avoided.