Give the page a base address for relative links.
Acceptance criteria
- 1.Give the page a base address for relative links.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <base> Tag chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “The <base> tag specifies the base URL and/or target for all relative URLs in a document. It defines a reference point so that links and resources (like images, CSS, or JavaScript files) without absolute URLs are resolved relative to the <base> URL.” .
1.Set a base URLexercise · easy · 10 min
Give the page a base address for relative links.
Passes when: Give the page a base address for relative links.
2.Open links in a new tabexercise · easy · 10 min · practice plan
Make every link default to a new tab.
Passes when: Make every link default to a new tab.
3.Base plus a relative linkexercise · easy · 10 min · practice plan
Add a base and a relative link that uses it.
Passes when: Add a base and a relative link that uses it.
4.Both base attributesexercise · easy · 10 min · practice plan
Set the base address and the default target together.
Passes when: Set the base address and the default target together.
5.A documented baseexercise · medium · 10 min · practice plan
Add a base URL and two relative links.
Passes when: Add a base URL and two relative links.
6.Fix the wrong attribute for the addressbug fix · easy · 8 min
The base address goes in href.
Passes when: The base address goes in href.
7.Fix the default target attributebug fix · easy · 8 min · practice plan
The default window is set with target.
Passes when: The default window is set with target.
8.Fix the absolute link that ignores the basebug fix · easy · 8 min · practice plan
Relative links are what a base is for.
Passes when: Relative links are what a base is for.
9.Fix the missing targetbug fix · easy · 8 min · practice plan
The base sets an address but no default window.
Passes when: The base sets an address but no default window.
10.Fix the missing second linkbug fix · easy · 8 min · practice plan
Only one page was linked.
Passes when: Only one page was linked.
Between them these tasks cover Base URL, Default target and Relative links.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.