How to write out HTML entity name ( , <, >, etc)
How would I write the entity name in HTML and not have it do its function? Example: I'm doing a tutorial and want to tell someone how to use the non-breaking space in their code (
) So, how to actually write out "&" "n" "b" "s" "p" ";" but have it be fluid with no spaces?
Solution 1:
You can use &
instead of &
So
will be &nbsp;
Solution 2:
You will need to write out a part of the code, in this example, I'll use the ampersand. Instead of writing
, write out the ampersand, &
, and then write nbsp;. Your final result should be &nbsp;
, which will display
on the webpage.
Solution 3:
You could simply use the HTML for the ampersand as in &nbsp;
which would display what you're looking for, i.e.