Forum Moderators: open

Message Too Old, No Replies

html code for the image

         

georgimakarti

4:14 pm on Jul 2, 2024 (gmt 0)

Top Contributors Of The Month



Can you guess tell me which way of href ing the image in the code is better. the one that uses the domain like this www.example.com/assets ... or just the folder path

not2easy

4:54 pm on Jul 2, 2024 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You can use the full URL or a relative link (the folder path), whichever you prefer. There may be a minuscule saving in code, but not enough to matter for CWV.

lucy24

6:10 pm on Jul 2, 2024 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In general, links to material on the same site should be in site-absolute form starting with / for the root. Among other things, that means you don't need to change anything if, say, you move from http to https, or change your mind about with/without www, or move some parts of the site to or from a subdomain.

When to use relative links (no leading / ) is a separate discussion.