Skip to main content
HTML Validation

Bad value X for attribute “href” on element “a”: Illegal character after “Y:”. Space is not allowed.

About This HTML Issue

An href value that starts with a word and a colon, such as Facebook: My Page, is read as a URL whose scheme is that word, and a URL can't have a space right after its scheme.

In a URL, everything before the first colon is the scheme (https, mailto, sms). The validator reads Facebook: My Page as a URL with the scheme facebook, then stops at the space that follows the colon. It quotes the scheme in lowercase, and for some known schemes only its last letters, so data: shows up as “ta:”.

The usual cause is a label pasted into the wrong field: a CMS or template puts the link text ("Facebook: My Page", "Phone: 555 0100") in the href instead of the address. Browsers treat such a value as an unknown scheme, so the link does nothing or opens a broken page. Put the real URL in href and keep the label as the link text.

If the value is a real URL with a stray space after the colon, like sms: +15550100, remove the space.

Invalid example

<p>
  <a href="Facebook: Example Guest House">Facebook</a>
  <a href="sms: +15550100">Send us a text</a>
</p>

Valid example

<p>
  <a href="https://social.example.com/exampleguesthouse">Example Guest House on Facebook</a>
  <a href="sms:+15550100">Send us a text</a>
</p>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries