2011-12-11 7 views
0

サイトの検証時に100のエラーが発生します。私はこれがうまくいくまでビルドを続けたくない。私は行ごとに行ってきました。なぜこれらの問題があるのか​​理解できません。ラフドラフトの開始ページはwww.flynntec.comです。例エラー:文書タイプで要素の問題が許可されない

document type does not allow element "h3" here; assuming missing "li" start-tag [XHTML 1.0 Transitional]

または

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>").

サンプルHTML続い

document type does not allow element "li" here; missing one of "ul", "ol", "menu", "dir" start-tag [XHTML 1.0 Transitional]

<li class="menu_right"><a href="#" class="drop">Access</a> 

    <div class="dropdown_5columns align_right"> 

     <div class="col_5"> 
      <h2>Microsoft Access</h2> 
     </div> 

     <div class="col_1"> 
     <img src="media/Access Logo.png" width="120" height="118" alt="Microsoft Access" /> 
     </div> 

     <div class="col_1"> 
      <ul class="greybox"><h3>Beginner</h3><li><a href="#">Welcome to Access</a></li> 
       <li><a href="#">The Power of Access</a></li> 
       <li><a href="#">Intro to Databases</a></li> 
       <li><a href="#">Intro to Tables</a></li> 
       <li><a href="#">Creating Forms</a></li> 
       <li><a href="#">More...</a></li> 
      </ul> 
     </div> 
     <div class="col_1"> 
      <ul class="greybox"><h3>Intermediate</h3><li><a href="#">Custom Queries</a></li> 
       <li><a href="#">Create Reports</a></li> 
       <li><a href="#">Primary Key Guide</a></li> 
       <li><a href="#">Filtering Quickly</a></li> 
       <li><a href="#">More...</a></li> 
      </ul> 
     </div> 

     <div class="col_1"> 
      <ul class="greybox"><h3>Advanced</h3><li><a href="#">Web Integration</a></li> 
       <li><a href="#">Advanced Forms</a></li> 
       <li><a href="#">Using Triggers</a></li> 
       <li><a href="#">Shortcuts</a></li> 
       <li><a href="#">Expression Builder</a></li> 
       <li><a href="#">More...</a></li> 
      </ul> 
     </div> 

     <div class="col_5"> 
      <h2>Additional Free Resources</h2> 
     </div> 

     <div class="col_3"> 

      <img src="media/youtube-logo.jpg" alt="YouTube Picture" name="youtube" width="90" height="70" class="img_left imgshadow" id="youtube_logo_2" /> 
      <p>Microsoft Access is an ideal small-business database engine. YouTube is a great source for Access guides. We have compiled the best, most popular Access tutorials from YouTube and put them here for your convenience. </p> 

      <br /> 
      <a href="http://office.microsoft.com/en-us/training-FX101782702.aspx" target="_blank"><img src="media/microsoft-logo__111129012732.jpg" alt="" name="microsoft" width="90" height="24" class="img_left imgshadow" id="microsoft_logo_2" /></a> 
      <p><a href="http://office.microsoft.com/en-us/training-FX101782702.aspx" title="Microsoft Training" target="_blank">Microsoft has fantastic resources on their website. Microsoft Training can be found here.</a></p> 
</div> 
</div> 
</li> 

はい、そこに開き、ULのを閉じています。

+2

なぜXHTML厳密なdoctypeですか?それは必要ですか? HTML5のdoctype <!DOCTYPE html>を使用できますか? – danludwig

+0

私はそれを考慮したことはありません - 使用する正しい構文は何ですか? – jdflynn55

+0

<!DOCTYPE html>< - これは、現在のdoctypeがある最初の行としてください。 – danludwig

答えて

2

あなたは、UL内に直接H3要素を持つことができません - すでに検証エラーの大部分を修正する必要があります...

2

明確にエラーとして - それは、Li内であることが必要である、またはULの前にあなたのHTMLは無効です。

<ul>は、(直接)<li>を含むことができます。

2

<ul>タグは<li>タグを内部に配置するためのものですが、の前には<ul>要素のタグは入れませんか?

3

一部のHTML要素には、他の特定のHTML要素のみを含めることができます。 ULにはLI要素しか含めることができないため、UL内のH3はエラーです。
H3をULから移動するか、LI内に配置します。
達成しようとしている効果は何ですか?

また、あなたのウェブページがXHTML Transitionalだと思っても、あなたはtext/html MIMEタイプを提供しているので、ブラウザはHTMLとして扱います。 本当にXHTMLが必要な場合は、MIMEタイプがapplication/xhtml+xmlであることを確認してください。しかし、古いバージョンのIEでは表示されません。

+0

H3にはボーダーボトムがあるため、メニューバーの上にマウスを置いたときに、初心者の下に見栄えのよいラインが表示されます。 – jdflynn55

+0

@ jdflynn55私は同じ行を達成するために他に約10の方法があると確信しています。 – kapa

1

XHTML <li>に含まれていない<h3>があなたの<ul>のすぐ内側にあるため、移行が苦情を申し立てています。これは実際には悪い習慣です。

<ul class="greybox"><h3>Beginner</h3><li><a href="#">Welcome to Access</a></li> 
       <li><a href="#">The Power of Access</a></li> 
       <li><a href="#">Intro to Databases</a></li> 
       <li><a href="#">Intro to Tables</a></li> 
       <li><a href="#">Creating Forms</a></li> 
       <li><a href="#">More...</a></li> 
      </ul> 
1

あなたはh3を最初にulの中に入れました。彼らはリストの外にいる必要があります。

関連する問題