HTML5のバリデートで下記のエラーが出ました

このQ&Aのポイント
  • HTML5のバリデータは日本語の物はまだないのでしょうか?
  • 実務ではどれくら、突っ込まれますか?下記を全部対応しろと言われますか?
  • ソースには下記のようにちゃんと文字コードはしていています。バリデートの問題でしょうか?
回答を見る
  • ベストアンサー

HTML5のバリデートで下記のエラーが出ました。

HTML5のバリデートで下記のエラーが出ました。 HTML5のバリデータは日本語の物はまだないのでしょうか? 実務ではどれくら、突っ込まれますか? 下記を全部対応しろと言われますか? ・ Warning No Character Encoding Found! Falling back to UTF-8. None of the standards sources gave any information on the character encoding labeling for this document. Without encoding information it is impossible to reliably validate the document. As a fallback solution, the "UTF-8" encoding was used to read the content and attempt to perform the validation, but this is likely to fail for all non-trivial documents. Read the FAQ entry on character encoding for more details and pointers on how to fix this problem with your document. ソースには下記のようにちゃんと文字コードはしていています。 バリデートの問題でしょうか? <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> ・Unable to Determine Parse Mode! => 解析モードを決定する事が出来ません! これは、実務でも無視して良いのでしょうか?良く分かりません。 ・No DOCTYPE found! Checking with default HTML 4.01 Transitional Document Type. No DOCTYPE Declaration could be found or recognized in this document. This generally means that the document is not declaring its Document Type at the top. It can also mean that the DOCTYPE declaration contains a spelling error, or that it is not using the correct syntax. The document was checked using a default "fallback" Document Type Definition that closely resembles “HTML 4.01 Transitional”. HTML5で作っているのですが、HTML 4.01 Transitionalドックタイプ宣言がないと言っているのでしょうか? ・ Info No Character encoding declared at document level No character encoding information was found within the document, either in an HTML meta element or an XML declaration. It is often recommended to declare the character encoding in the document itself, especially if there is a chance that the document will be read from or saved to disk, CD, etc. <meta charset="utf-8"> があるので無視して良いのでしょうか? ・他にも下記のように終了タグがないようなことをいっていますが、終了タグはあります。 良くあるエラーなのでしょうか? Line 1, Column 913: end tag for "HTML" which is not finished … your browser or use a browser with Javascript support</noscript></body></html> Line 1, Column 75: required attribute "TYPE" not specified …cript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replac… ・Error Line 1, Column 12: document type does not allow element "BODY" herebody の位置は間違えていないと思うのですが、改善点があるのですか? ソース  </head> <body class="top-body"> <div class="container"> ・ Line 1, Column 1: no document type declaration; implying "<!DOCTYPE HTML SYSTEM>" バリデータがおかしいのでしょうか? ソース <!DOCTYPE html> <html lang="ja"> <head> ・ Line 1, Column 12: document type does not allow element "BODY" here <html><body><script type="text/javascript" src="/aes.js" ></script><script>func… The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). バリデータがおかしいのでしょうか? ソース  </head> <body class="top-body"> <div class="container">

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

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

  • ベストアンサー
  • tracer
  • ベストアンサー率41% (255/621)
回答No.1

そもそもですが、ファイルのテキストエンコーディングはUTF-8になってますか? あと、どのバリデータにかけたのでしょうか? どんな検証でも同じですが、まずエラーが出ない状態を作って、どのポイントからエラーが発生するかを見極めてみてはどうでしょう。

noname#226032
質問者

お礼

W3C Markup Validation Service です。 サブライム上でutf-8と出ています。

その他の回答 (3)

  • Gotthold
  • ベストアンサー率47% (396/832)
回答No.4

> バリデート上にそう書いてあっただけでソースは下記です。 だから、バリデータがそのソースを取得できていないのではないかという話なのですが。 W3C Markup Validation Serviceの「More Options」内にある「Show Source」にチェックを入れると、 バリデータが取得したソースコードが表示されるので、期待通りのソースが取得されているか確認してみてください。

noname#226032
質問者

お礼

> だから、バリデータがそのソースを取得できていないのではないかという話なのですが。 erasounarougaiji

  • tracer
  • ベストアンサー率41% (255/621)
回答No.3

> 実務ではどれくら、突っ込まれますか? > 下記を全部対応しろと言われますか? 質問者さんの場合は、明らかな構文ミスなのですから、完全対応が普通でしょう。むしろ、対応ですらなく、「誤り」なのですから、修正するのが筋です。 > バリデータがおかしいのでしょうか? とても高い確率であなたのソースがおかしいです。 バリデータを理解するのに特に英語力は必要ないと思います。 必要なのはあなたのデバッグ力です。 正直なところ、htmlの全体がないと、この場では答えがでません。 先に書きましたが、まずは、エラーのでないポイントを探してみてください。 簡単に言うと、大幅に内容を削るということです。 それで、完全にエラーがでない時点を作り、そこから徐々に内容を足していく作業をすると、エラーのポイントが分かります。地道ですが、見当もつかない原因の時は、これが確実ですよ。

  • Gotthold
  • ベストアンサー率47% (396/832)
回答No.2

W3C Markup Validation ServiceでのチェックはValidate by URIで行ったのでしょうか? > ・ Line 1, Column 12: document type does not allow element "BODY" here > <html><body><script type="text/javascript" src="/aes.js" ></script><script> 明らかにHTMLソースが <html><body><script type="text/javascript" src="/aes.js" ></script><script> から始まっています。 試しに自分でも(wgetとかで)ダウンロードしてみて期待したHTMLが取得できている調べてください。 また、使っているWebサーバーに変なツール(難読化とか)を導入していないか確認してください。

noname#226032
質問者

お礼

バリデート上にそう書いてあっただけでソースは下記です。 <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="robots" content="noindex,noimageindex,nofollow" /><!-- Onlysample --> <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> <meta name="format-detection" content="telephone=no" />

関連するQ&A

  • 何がダメなのかわからない

    http://validator.w3.org/check?uri=referer で自分のサイトを見てみたら、 62 Errors, 3 warning(s) となり、たくさんのエラーに驚きました。 ただなぜエラーになるのかわからない部分があります。 例えば、 <body text="gray" link="#808080"> がエラーとなっていますが、何がいけないのでしょうか? --------------------------------------------------------- Line 10, Column 12: there is no attribute "TEXT" <body text="gray" link="#808080"> ✉ You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash. --------------------------------------------------------- と書いてあります。

    • ベストアンサー
    • HTML
  • w3cの検証エラー?

    サーバーにアップしてあるサイトからw3cのチェックすると下記のようなエラーが出ます。 Sorry! This document can not be checked. Result: Failed validation Address: http://www.hogehoge.com/ Encoding: euc-jp Doctype: Sorry, I am unable to validate this document because on line 179 it contained one or more bytes that I cannot interpret as euc-jp (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication. The error was: euc-jp "\x83" does not map to Unicode 何が原因なのか全くわかりませんがどのようにしたら検証することができるようになるのでしょうか? Nucleus v3.3でサイトを作ったのでそれが原因かと思い他のNucleusで作られたサイトを見てみましたがエラーになっていませんでした。 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" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" /> ~省略~ としています。 firefoxのhtmlをチェックする機能?ではエラーもなく判定されます。

  • 下記の英文をどうかどうか翻訳して下さい。

    できないなりにPCの翻訳機を使いながら翻訳してるのですが、私の手にはおえず… 大変困っております。 We have received a claim under the A-to-z Guarantee program for order 702-5397143-0931462 because the buyer in this transaction believes the item(s) sent were materially different from how they were listed. This could mean that the item(s) are defective or damaged, that the wrong item(s) were sent, or that the item condition and/or details are different from what was represented in the product listing. The buyer's comments were "Terrible item, hurts feet, is not at all worth $180.00. Seller refunded $44.... That is in no way fair. Seller is also claiming shipping is $50 for a cheque. That is also impossible. Please resolve this issue.- : -Terrible item, hurts feet, is not at all worth $180.00. Seller refunded $44.... That is in no way fair. Seller is also claiming shipping is $50 for a cheque. That is also impossible. Please resolve this issue". Please note that you have seven (7) days to respond to this e-mail. Failure to respond with all the information below may result in a debit to your Marketplace Payments account. If a partial refund has been given we do require a response to the claim notification explaining the reason a full refund was not provided, failure to do so may result in a debit to your Amazon Payments account. If you accept this claim or want to defend this claim, the easiest and quickest way to refund the buyer or represent yourself is to use online A-to-z Guarantee forms. By doing so, you will ensure faster resolution between the buyer and yourself. Do not reply to this email if you use the on-line forms. よろしくお願いいたします。

  • htmlがわかる方、教えてください

    ブログで音声を出したいのですが ボタンをクリックすると英単語が読み上げられるようにしたいのです。 友人に頼んでソースを作ってもらったのですが、 以下をブログ記事にコピペしてもボタンだけ表示されて音声が出ません。 どうすればよいかわかりますか? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>音声サンプル</title> <script language="JavaScript"> <!-- function sendForm(person,text) { document.demoForm.voice.value = person; document.demoForm.txt.value = text; document.demoForm.submit(); } //--> </script> </head> <body> <FORM METHOD="post" NAME="demoForm" ACCEPT-CHARSET="iso-8859-1" ACTION="http://192.20.225.55/tts/cgi-bin/nph-talk"> <input type="hidden" name="voice" value=""> <input type="hidden" name="txt" value=""> <input type="button" name="send" value="speak1" onclick="sendForm('crystal','This is a pen.')"> <input type="button" name="send" value="speak2" onclick="sendForm('mike','This is an apple.')"> <input type="button" name="send" value="message" onclick="sendForm('claire','message')"> </FORM> </body> </html>

  • XHTML1.1で空要素タグを書くと、W3CのValidatorでエラ

    XHTML1.1で空要素タグを書くと、W3CのValidatorでエラーが出てしまいます。 下記のXHTMLをW3CのValidatorでチェックをすると、body内の<br />の箇所でエラー出てしまいます。 =========================================================== <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis" /> <title></title> </head> <body> <br /> </body> </html> =========================================================== エラーの内容は下記の通りです。 document type does not allow element "br" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "pre", "address", "fieldset" start-tag <br /> The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). =========================================================== <img>などの<br />以外の空要素タグを入れても同様のエラーが出ます。 ただし、<div><br /></div>とするとエラーが出ません。 XHTML1.1の仕様では、空要素タグはブロック要素タグなどで囲わないといけないのでしょうか? もしくは、記述になにか間違いがあるのでしょうか? ご教示をお願いいたします。

    • ベストアンサー
    • HTML
  • PHPで、HTMLメールの際のエラー

    HTMLメールを送る下記スクリプトにおきまして、管理人宛てのメール本文を 見ると、添付画像のように、生のHTML文のついたメールが届いてしまいます。 普通のHTMLメールにするには、どこがどう間違っているのか、ご指導いただき たいです。 ちなみにサーバーはさくらサーバーです。 --------------------------------------------------------------------------------------------------------------- ////////////////////////////////////////// // 新着口コミを管理人にメールで知らせる // ////////////////////////////////////////// $to = "~"; // 管理人宛て $mail_title = " ユーザーが新着口コミを投稿しました。"; $header = "From: ~ Content-Type:text/html; charset=ISO-2022-JP Content-Transfer-Encoding:8bit "; //$uniqid = uniqid(); $to = mb_convert_encoding($to, "UTF-8", "auto"); // $toは、自動的にエンコードされない。 $mail_title = mb_convert_encoding($mail_title, "UTF-8", "auto");    $html_header = '<!DOCTYPE html"><html><meta http-equiv="Content-Type" content="text/html; charset=ISO-2022-JP"></head><body bgcolor="#FFFFCC">';    $html_footer = '</body></html>'; $comment_header = $username." 様\n\n口コミ店舗名:".$shopname."\n\n"; $comment = $html_header."\n\n".$comment_header.$comment."\n\n"; // $comment = str_replace("<br>", "\n", $comment); // $comment = mb_convert_encoding($comment, "UTF-8", "auto"); $comment_anchor = "<a href=\"http://~.com/tokyo/admin/kuchikomi_edit.php?title=".$title."&comment=".$comment_copy."&username=".$username."&shopname=".$shopname."\">口コミ編集</a>"; $comment_anchor = mb_convert_variables($comment_anchor, "UTF-8", $title, $comment_copy, $username, $shopname); $comment = $comment."\n\n".$comment_anchor.$html_footer; $comment = mb_convert_encoding($comment, "UTF-8", "auto"); $header = mb_convert_encoding($header, "UTF-8", "auto"); mb_send_mail($to, $mail_title, $comment, $header); // メール送信

    • ベストアンサー
    • PHP
  • CPのデメリット

    There are no restrictions as to type of corporation that can enter into this market. That is why a corporation that uses the commercial paper market for short-term financing is not advantage. どう解釈したらいいでしょうか。no restrictionがrestrictionでないと意味が通じないと思うのですが?

  • [W3C] dtd型「Strict」における<noscript>と<style>について

    お世話になります <noscript>は<body>内に入れないといけないですし<style>は<head>内に入れないといけないという矛盾が生じて解決できないのですが・・・ javascriptでdisplay:block;しているので未対応用に<noscript>でdisplay:block;しておきたいのですがうまくいきません かといって初めからdisplay:block;してjavascriptでonload display:none;すると一瞬表示されてからdisplay:none;されてしまいます <body> <noscript> <style type="text/css"><!-- #title { display:block; } --></style> </noscript> </body> とすると『2エラー』 ・<style>はここではありません   (document type does not allow element "STYLE" here.) ・</noscript>が閉じられません   (end tag for "NOSCRIPT" which is not finished.) といった感じのエラー <body> <noscript> <div> <style type="text/css"><!-- #title { display:block; } --></style> </div> </noscript> </body> とすると『1エラー』 ・<style>はここではありません <head> <title></title> <noscript> <style type="text/css"><!-- #title { display:block; } --></style> </noscript> </head> <body> とすると『4エラー』 ・<style>はここではありません ・</noscript>が閉じられません ・</head>が開いていません   (end tag for element "HEAD" which is not open.) ・<body>はこの位置ではありません   (document type does not allow element "BODY" here.) のような感じになってしまいます 『Transitional』にしても『<style>はここではない』エラーがでてます Another HTML-lint gatewayでは100点取ることなど不可能だと分かっているのでせめてW3C Markup Validation Service(http://validator.w3.org/)で緑にしておきたいのですが・・・ 今作成中のページではここだけがエラー対象になっているのですが回避できるのでしょうか?

    • ベストアンサー
    • HTML
  • W3CのHTML結果とCSS結果の問題点を改善策を教えてください。

    W3CのHTML結果とCSS結果の問題点を改善策を教えてください。 ●HTML結果 ワーニングが1個になりました。UTF-8を使ったら駄目ということですか??? Passed, 1 warning(s) Using Direct Input mode: UTF-8 character encoding assumed Unlike the “by URI” and “by File Upload” modes, the “Direct Input” mode of the validator provides validated content in the form of characters pasted or typed in the validator's form field. This will automatically make the data UTF-8, and therefore the validator does not need to determine the character encoding of your document, and will ignore any charset information specified. If you notice a discrepancy in detected character encoding between the the “Direct Input” mode and other validator modes, this is likely to be the reason. It is neither a bug in the validator, nor in your document. ●CSS結果 警告が5個出ました。 下記のエラーの改善策がわかりません。助けてください。 ul#topmenu li In (x)HTML+CSS, floated elements need to have a width declared. Only elements with an intrinsic width (html, img, input, textarea, select, or object) are not affected ●CSS ul#topmenu li a {display: block; width: 120px; line-height: 30px; text-decoration: none; text-align: center; color: #ffffff; background-color: #005087; background-image: url(rollover.png); border-right: solid 1px #ffffff}

  • RasPPPoEでエラーが出る

    RasPPPoEをインストールしたのですが、 RASPPPOE - TAPI Initialization Failure Make sure the "Telephony" service is not disabled: Click Start, select Run... and type "services.msc" , then locate the "Telephony" service in the list and double-click it to get its properties. Make sure that Startup tipe: is not set to Disabled. If it is, change the setting to Manual, then run this program again. と出てしまいました。どうすればよいでしょうか?

専門家に質問してみよう