0
0
HTMLmarkup~5 mins

Absolute vs relative URLs in HTML - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is an absolute URL?
An absolute URL is a full web address that includes the protocol (like https://), domain name, and the full path to a resource. It points to the exact location on the internet.
Click to reveal answer
beginner
What is a relative URL?
A relative URL points to a resource based on the current page's location. It does not include the domain name or protocol, just the path relative to the current page.
Click to reveal answer
beginner
Example of an absolute URL?
https://example.com/images/photo.jpg is an absolute URL because it includes the protocol (https://) and the full domain name.
Click to reveal answer
beginner
Example of a relative URL?
images/photo.jpg is a relative URL because it points to a file inside the 'images' folder relative to the current page.
Click to reveal answer
intermediate
Why use relative URLs instead of absolute URLs?
Relative URLs make it easier to move or copy a website to a different domain without changing all links. They also keep links shorter and simpler.
Click to reveal answer
Which URL is absolute?
Ahttps://mysite.com/about.html
Babout.html
C/images/logo.png
D../contact.html
What does a relative URL depend on?
AThe browser type
BThe internet speed
CThe current page's location
DThe server's IP address
Which is a benefit of using relative URLs?
AThey always load faster
BLinks work even if the site domain changes
CThey include the full domain name
DThey require no folder structure
Which URL is relative?
A/css/styles.css
Bhttps://example.com/index.html
Chttp://example.com/page
Dhttps://cdn.example.com/script.js
What does an absolute URL always include?
AOnly the file extension
BOnly the file name
COnly the folder path
DProtocol and domain name
Explain the difference between absolute and relative URLs in your own words.
Think about whether the URL includes the full web address or just a path.
You got /3 concepts.
    Why might a web developer choose to use relative URLs instead of absolute URLs?
    Consider what happens if the website address changes.
    You got /3 concepts.