0 votes
by (230 points)
closed by
Hi there. I'm trying to use HTML character codes "&uar;" and "&dar;" to display arrows inside anchor tags, but they simply appear as written. Is there some extra code I need to make them display as symbols?

 

Thanks
closed with the note: Resolved

1 Answer

0 votes
by (68.6k points)
selected by
 
Best answer

For questions like this, in general, you really should give examples of what you're attempting so we can see if there's an issue in your code.

In this case, I'll assume you're putting the character entity references in the correct place and the problem is simply that you're not using valid references.  Assuming you want the upwards and downwards arrows, they are as follows (entity, decimal, hexadecimal):

<!-- upwards arrow -->
&uarr;
&#8593;
&#x2191;

<!-- downwards arrow -->
&darr;
&#8595;
&#x2193;

TL;DR: You're probably just using invalid entity references—one too few "r".

by (230 points)

I put what I have inside my anchor in quotes in my original post, but here is the full HTML for the tag. Hopefully I get the code thing to work; I'm blind and this site is proving very difficult to navigate.

 

<a role="button" aria-label="move up" class="move-up">
				&uar;
			</a>

 

by (68.6k points)
edited by
Correct the entities as I noted previously and it should work.  Both are short an "r".  For example, the upwards arrow should be: &uarr;
by (230 points)
Ah, okay. I completely missed that there were two 'r's. I'm having to relearn to code and navigate/learn things now that I've lost the rest of my sight, and I've missed a few obvious things. Thanks. It's working now.
...