Special characters in HTML

Posted by Sahoo under HTML 5 on 11/17/2012 | Points: 10 | Views : 1332 | Status : [Member] | Replies : 3
I have designed a html page where code look like following


<!DOCTYPE	html	PUBLIC	"-//W3C//DTD XHTML 1.0 Transitional//EN"	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">	<html	xmlns="http://www.w3.org/1999/xhtml">	<head>	<meta	http-equiv="Content-Type"	content="text/html;	charset=UTF-8"	/>	<title>Title</title>	</head>	<body	style="margin:0;"><div	id="alignment"	align="center">		<table	id="border"	bgcolor="#e5e5e5"	border="0"	cellpadding="20"	cellspacing="0"			width="726">				<tr><t<td	style="font-family:	Arial,	Helvetica,	sans-serif;	font-size:	19px;	color:	#FFF;													background:	#080808;"	align="left">													hi-boss												</td></tr>				</table>	</div></body>	</html>





but in output I get hi?boss instead of hi- boss.


Can any one say , what I miss here.

Many thanks in advance




Responses

Posted by: Sandhyab on: 11/17/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Sahoo,
I executed your code. But, Output is hi-boss. Please, Can you tell what exactly you want.

Thanks & Regards

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Deepraj on: 11/17/2012 [Member] Starter | Points: 25

Up
0
Down
Hi shahoo,
I think we have no problem in displaying symbol minus '-',
For displaying special characters we follow different approach like for displaying '<' we use &lt
Please refer following link
http://www.w3schools.com/html/html_entities.asp
http://brucejohnson.ca/SpecialCharacters.html

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sandhyab on: 11/17/2012 [Member] Starter | Points: 25

Up
0
Down
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body style="margin: 0;">
<div id="alignment" align="center">
<table id="border" bgcolor="#e5e5e5" border="0" cellpadding="20" cellspacing="0"
width="726">
<tr>
<td style="font-family: Arial, Helvetica, sans-serif; font-size: 19px; color: #FFF;
background: #080808;" align="left">
hi&ndash;boss
</td>
</tr>
</table>
</div>
</body>
</html>


Try this. And, For special characters refer this link
http://www.utexas.edu/learn/html/spchar.html

Please mark as answer if this helped you.
Thanks & Regards

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response