• ベストアンサー

</a>は必要あるのですか?

とある参考書ですが、最後の</a>って要りますか?何のためにこれがあるのか意味がわかりません。 <!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> <style type="text/css"> h1 { font-size: 1.5em; background-color: yellowgreen; } h2 { font-size: 1.2em; background-color: khaki; } </style> </head> <body> <h1>ローマの見どころ</h1> <h2>サンピエトロ大聖堂</h2> <p>カトリックの総本山。ヴァチカンのサンピエトロ大聖堂。聖堂の上に登ったり、巨大な堂内を見学したりできる。</p> <h2>サンタンジェロ城</h2> <p>サンタンジェロ城。ローマ時代に作られた円形のお城。この城の前にかかっている橋は「ローマの休日」の舞台になりました。</a></p> </body> </html>

  • HTML
  • 回答数3
  • ありがとう数4

質問者が選んだベストアンサー

  • ベストアンサー
  • naokita
  • ベストアンサー率57% (1008/1745)
回答No.3

著 佐藤 和人さんの本ですね。 最後の </a> は不要です。 本文から使いまわしている例文の為に </a> を削除し忘れたと思います。 本来なら <a> </a> となりますからね。

kjfcaoi
質問者

お礼

あっ、すごいですね。w そうです。 あ~そうなんですかぁ~! タグなら開始タグと終了タグがひと組になりますもんね。

その他の回答 (2)

回答No.2

直接的な回答ではありませんが、出版社のHPに正誤表のようなものがあるかもしれません。 下記のURLはその例です。 http://www.shuwasystem.co.jp/support.html

kjfcaoi
質問者

お礼

ハガキじゃないと正誤についての問い合わせはできないんですよ。サイトの正誤表にはこの間違いはなかったです。

  • LegaC2
  • ベストアンサー率52% (224/428)
回答No.1

多分、その参考書の単なるミスだと思います。 このHTMLを見る限り、</a>は不要です。 何の意味も成していません。

kjfcaoi
質問者

お礼

ですよね。 やっぱりそうでしたか。

関連するQ&A

  • ブラウザ上部に余白があります。

    近い現象はありましたが、解決出来なかったのでご質問させて頂きます。 下記のソースでhtmlを制作しましたが、#headerの上に余白があります。 どうすればこの余白をとる事が出来るでしょうか? お教え頂ければと思います。 ↓ソース↓ <!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> <style type="text/css"> <!-- html, body{ margin:0; padding:0; } div#header{ background-color: #F00; margin:0px; padding:0px; } --> </style> </head> <body> <div id="header"> <h1>test</h1> </div> </body> </html>

  • ホームページの上下の隙間を消すには

    左右にだけ背景があるよくあるページを作ろうと一から自分で作り始めたのですが色々いじってもなぜかどうしても上下に隙間ができてしまいます。 上下がぴったりつく方法を教えて下さい。 ------------------------------------------------------------------------- <!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=shift_jis" /> <title>無題ドキュメント</title> <html> <style type="text/css"> <!-- #main { width: 800px; margin-right: auto; margin-left: auto; background-color: #FFFFFF; } body { margin:0px; padding:0px; background-color: #999999; } --> </style> </head> <body> <div id="main"> <p><img src="images/head_01.gif" width="800" height="1000" /></p> </div> </body> </html>

  • XHTML のタイトルが表示されません ご教授おね

    タイトル通りなのですがHTML のタイトルが上手く表示されず、本文の中に入ってしまっています。(cf,添付画像)   一番最初の所で躓いてしまいました、解説書の通り何度もやり直したのですが、原因が分からないのです・・・かなり初歩的なこととは思われますがよろしくお願いいたします! ソースは以下のとおりです。 <!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" /> <titile>a</title> <style type="text/css"> </style> </head> <body> </body> </html> *ちなみにサンプルでは以下のとおりになっています。(サンプルをインストールすればしっかりと表示されるのです、同じなはずなのに僕が入力しますと上手くいきません) <!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>a</title> <style type="text/css"> </style> </head> <body> </body> </html>

    • ベストアンサー
    • CSS
  • i-modeでxhtmlをみるには、、

    Perlからxhtmlをはきだして、i-modeで見れるようにしたいのですが、 表示がうまくいきません。 ヘッダーは Content-type: text/html; charset=Shift_JIS <?xml version="1.0" encoding="Shift_JIS"?> <!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" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> こんな感じです。 「Content-type: text/html; charset=Shift_JIS」の部分を 「Content-Type: application/xhtml+xml」や 「Content-Type: application/xhtml」等でやっても表示されませんでした。 もし分かる方がいましたら教えてください。 宜しくお願いします。

    • 締切済み
    • XML
  • CSSのアドバイスをお願いいたします。

    <?xml version="1.0" encoding="Shift_JIS"?> <!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" lang="ja" xml:lang="ja"> <head> <meta name="robots" content="noindex,nofollow,noarchive" /> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> .r { color : #407133; } .k { color : #336070; } .t { color : #454580; } .s { color : olive; } p { color : #222222; } body { background-color:#e0ffe0; } a:link { color : #0000ff; } a:visited { color : #003333; } a:hover { color : #660000; } a:active { color:#660066; </style> <meta http-equiv="Content-Script-Type" content="text/javascript" />の1行を加えてみました。 この場合の記述の是非。 また記述すべき個所は合っているのでしょうか。

    • ベストアンサー
    • HTML
  • SafariでPHPソースがそのまま表示される

    Safariでindex.phpを開くとソースコードがそのまま表示されてしまいます。 拡張子をphpとしているだけでソース内にはphpスクリプトは記述しておりません。 なぜでしょうか? ※ファイル名をindex.htmlに変えると正しく表示されます。 Windows 7 Home Premium 64bit Safari5.1.5 ソースコードのエンコーディング:utf-8 <!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" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="content-style-type" content="text/css" /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <title>テストtitle> </head> <body> <h1>テストページ</h1> </body> </html>

  • XHTMLのソースで文字ばけします

    とあるHTMLの本に書いてあるとうりソースをうっていくと <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtyd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"content="text/html;charset=utf-8"/> <title>もりのみや<title/> などのWeb上で文字入力をすると文字化けします。 どうしてでしょうか? インターネットエクスプローラーを使っています。

  • cssがIE6で適用されない理由は

    教則本を見てcss/xhtmlでサイトを作ったのですが、 (教則本がIE7以降対応だった為) safari firefoxd IE7では表示がうまくいくのですが、 IE6では全くcssが適用されないです。 少し調べたところこの辺の記述に問題があるのかなと思っています。 誰か教えて下さい。 ............................................................................... <!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" xml:lang="jap" lang="jap" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Script-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> ....................................................................

    • ベストアンサー
    • HTML
  • xhtmlのスタイルシートについて

    <?xml version="1.0" encoding="Shift_JIS"?> <!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" lang="ja" xml:lang="ja"> <head> <meta name="robots" content="noindex,nofollow,noarchive" /> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <style type="text/css"> t { color : 407133; k { color : 337060; r { coior : 454580 &gt; </style> ↑どこか間違っているところがありましたら教えてください。 <span class="#407133">てすと</span> 文字色が変わりません。 どなたか指摘願います。

  • Firefoxにpaddingが反映されない

    ホームページ作成初心者です。 コンテンツ全体を罫線で囲って線と内容の間に余白を入れたいのですが、 IEでは余白ができるのにFirefoxでは線と内容がくっついてしまいます。どうすればIEと同じように表示できますか? <?xml version="1.0" encoding="Shift_JIS"?> <!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" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS" /> <style type="text/css"> body{color: #444444; background-color: #ffffff; margin-left: 3em; margin-right: 2em; margin-top: 0em; margin-bottom: 0em;} h1{font-size:1.1em; color: #663333;} p {font-size: 0.75em; color: #000000; line-height: 1.35em} div {font-size: 1em; color: #000000; line-height: 1.35em} a {color: #000000; text-decoration: none;} a:hover {color: #696969;} a:visited {color: #d2b48c;} ul {list-style-type: none; margin-left: 0em; padding-left:0em;} li {display: inline; padding-right: 3px; font-size: 0.75em;} div#box {border-style: solid; border-width: 1px; border-color: #336666;     padding: 1em; } </style> </head> <body> <div id="box">○○</div> </body> </html>

    • ベストアンサー
    • HTML