1

Is this a valid HTML code?

I replaced / with it's html-code / Refer: https://www.htmlsymbols.xyz/unicode

<a href=&sol;sample2.htm>Using html code for slash</a>

When I try this code in chrome, it does work, the link is shown properly. Wondering if this is valid?

pyNag
  • 113
  • 2
  • 9
  • Possible duplicate of [Is it okay to use HTML entities in attributes?](https://stackoverflow.com/questions/12444605/is-it-okay-to-use-html-entities-in-attributes) – agrm Aug 03 '19 at 11:03

1 Answers1

0

Slashes do work in HTML <a href> tags. You should probably use those to keep your <a href> links shorter.

So you can have

<a href="/sample2.htm">Using html code for slash</a>

Also a tip, in <a href> you need quotes when hyperlinking to another webpage, like I put mine.

amateur_coder
  • 62
  • 1
  • 12