Which is preferable to use in the alt text "&" or "& amp;" for users of screen firmware?

Services & Products

or

Services and Products

Update:

How popular screen readers and text browsers will handle & ?

+7
cross-browser accessibility xhtml screen-readers
source share
4 answers

Screen readers will read "&" as "and", and text browsers will display it as "&".

The reason you write & , is that "&" is a special character in XHTML and must be escaped. Any browser / screen analyzer that understands XHTML knows that & - This is a shielded ampersand ('&') and displays it as such or reads it aloud as an "and".

If you are writing an XHTML document, this is not an example of how to make your alt text more readable from the screen, you should replace your bare ampersands with & or the risk that your document will not check and potentially display incorrectly.

+6
source share

In HTML, it doesn't matter (since an ampersand is followed by a space).

In XHTML - & there is a correctness error and is completely unacceptable.

+6
source share

You must remove the usual & with a character reference , for example & To have a valid XHTML document:

The ampersand character ( & ) [...] can be displayed in their literal form only when used as markup delimiters or in a comment, processing instruction, or CDATA section. If needed elsewhere, they must be escaped using either numeric characters or the string " & " [...]

+3
source share

Always avoid the ampersand character with the proper character encoding. In HTML, this is & or. In the URI, this is% 26, and not one of the previous two. Missing syntax characters will cause XML to fail. If your HTML is ever integrated or interpreted by the XML engine, your code will break.

0
source share

All Articles