I know that the proper way to handle file/directory paths is to use Path.AltDirectorySeparatorChar
, but does this apply to html source paths?
Or, is it that the backslash is the required path separator for html? I've always done it using the backslash (i.e. <img src="images\birthdaysurprise.jpg" />
), but now I'm wondering if I've been doing it improperly this entire time?
While I don't know the exact letter of the law, use the forward slash for all path separators. Even Windows can use a forward slash as a separator in its APIs.
Using a backslash may work under a windows platform but:
\
starts an escape sequence in many instances, so \n
could translate in an unexpected way.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With