I'm tring to write a code to show html entites as they are like this
© => & copy;
Now here if i don't add a space b/w '&' and 'copy;' it will show as the copyright symbol which i don't want.
<body> <p>This is <br> © => © </p> <pre> <code> © </code> </pre> </body>
You can show a & sign using &
So &copy;
would render ©
as text
Put '&' or 'copy' in a span tag.
<body> <p>This is <br> © => &<span>copy<span>; </p> <pre> <code> © </code> </pre> </body>
To do this, you have to use the entity for the &
symbol. For ©
, you would have to type:
$amp;copy;
This will return: © (this is written as it is)
Just use an entity for the ampersand.
<p>This is <br> &copy; => © </p>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.