0
Difference between relative, absolute, and fixed URLs
pranav m
walmarteasy
0completed
29
Answer
- Relative URL
- Relative to the current page’s path.
- Example:
If page is/products/index.html:<img src="images/pic.jpg">→/products/images/pic.jpg
- Absolute URL
- Full path including scheme & domain.
Example:<a href="https://example.com/images/pic.jpg">Link</a>
- Full path including scheme & domain.
- Fixed (a.k.a Root-relative URL)
- Starts from root
/of the domain.
Example:<img src="/assets/logo.png">→ always loads/assets/logo.pngno matter current folder.
- Starts from root
Click to Reveal Answer
Tap anywhere to see the solution
Revealed
Comments0