html · level 3 · unit 2 · lesson 4
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
fetchpriority="high" puts the first in the queue.
The hero is the big picture at the top of a page. How fast it appears decides how fast the whole page feels. Browsers guess which downloads matter most, but they cannot know which picture is your hero.
fetchpriority gives a download its . fetchpriority="high" on the hero moves it up the queue, and fetchpriority="low" on a small picture moves it down. Leave everything else alone.
The hero must never be lazy: lazy means wait, and high means hurry. Lazy and low suit the pictures further down.
<h1>Sunny Side Café</h1>
<img src="cake.svg" alt="Our famous lemon drizzle cake"
width="800" height="500" fetchpriority="high">
<h2>Find us</h2>
<img src="logo.svg" alt="The Sunny Side Café sign"
width="100" height="100" fetchpriority="low">
<h2>Our garden</h2>
<img src="tree.svg" alt="Tables under the apple tree"
width="800" height="500" loading="lazy"> Press show my page to see it here.
Use high on one picture only. If everything is important, nothing is.
guess first
Which picture does the browser hurry?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<img src="dog.svg" alt="A dog leaping for a frisbee"
width="800" height="400" fetchpriority="high">
<img src="ball.svg" alt="A muddy tennis ball"
width="200" height="200" loading="lazy">
your turn
Your turn. Set the priorities.
Make the hero on lines 2 and 3 download first, and the club badge on lines 5 and 6 download last. Fill both fetchpriority blanks.
Press show my page to see it here.
- the hero downloads firstnot checked yet
- the badge downloads lastnot checked yet
fix it
The hero is told to hurry and to wait. Can you fix it?
Press show my page to see it here.
- the hero is not lazynot checked yet
- the hero still has high prioritynot checked yet
- This picture is told to hurry and to wait at the same time. Which is right for a hero?
- The hero is in view from the start, so it must never be lazy.
- Delete
loading="lazy"from line 3, then press run.
nailed it
your hero arrives first. :D
- The hero picture decides how fast a page feels.
fetchpriority="high"on the hero,lowon minor pictures.- Never make the hero lazy.
new words in your collection
- hero
- priority
This lesson isn’t saved. A free account remembers every lesson you finish.