← BYTES
HTML·Intermediate·Ref: 2.2.20
What effect does a `<base href="https://example.com/docs/">` element in a page's `<head>` have on the rest of the page?
Have a question about this video? Mention reference 2.2.20 when you contact us.
a.It sets the page's default background color
b.It changes the base URL that ALL relative URLs on the page (in href, src, action, etc.) are resolved against, rather than the page's own actual URL
c.It only affects the behavior of <a> tags, not <img> or <form> elements
d.It has no effect unless JavaScript explicitly reads it
Once declared, every relative URL elsewhere in the document -- in <a href>, <img src>, <form action>, and more -- resolves against the <base> URL instead of the page's own location, which can cause confusing, hard-to-debug broken links/images if a developer isn't aware a <base> tag is present and forgets to account for it, or if it's included more than once (only the first is used).
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES2220#HTML