&番号; ‥‥文字コードを番号で指定する
&キーワード;‥‥キーワードを使って指定する
&キーワード;‥‥キーワードを使って指定する
特殊文字 | 番号 | キーワード | 特殊文字 | 番号 | キーワード |
---|---|---|---|---|---|
& | & | & | ’ | ’ | ’ |
< | < | < | ” | ” | ” |
> | > | > | ‚ | ‚ | ‚ |
" | " | " | „ | „ | „ |
© | © | © | ‘ | ‘ | ‘ |
® | ® | ® | “ | “ | “ |
· | · | · |   |   |
HTMLでは、「<」や「>」はタグを表すために使用されますので、そのまま書くとタグの一部だと解釈されて表示されません。
そのような特別な意味を持ったキーボードから直接入力できない文字を表示させたい場合には、上記表のように、
「&○○;」というように入力します。キーワードで入力する場合は、大文字・小文字が区別されます。
HTML4.01で定義されている特殊文字一覧
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>特別な文字を表示させる。</title>
</head>
<body text="black" bgcolor="#FFF8DC">
<html lang="ja">
<head>
<title></title>
</head>
</body>
</html>
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>特別な文字を表示させる。</title>
</head>
<body text="black" bgcolor="#FFF8DC">
<html lang="ja">
<head>
<title></title>
</head>
</body>
</html>
Internet Explorer8での表示例
