0

Difference between relative, absolute, and fixed URLs

author
pranav m
easy
0
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>
  • Fixed (a.k.a Root-relative URL)
    • Starts from root / of the domain.
      Example:
      <img src="/assets/logo.png"> → always loads /assets/logo.png no matter current folder.

Click to Reveal Answer

Tap anywhere to see the solution

Revealed

Comments0
    Difference between relative, absolute, and fixed URLs - fixed urls | EBAT