2011-12-11 2 views
0

내 사이트의 유효성을 검사 할 때 100 개의 오류가 발생합니다. 이 작업을 완성 할 때까지 빌드를 계속하고 싶지 않습니다. 내가 한 줄 씩 지나갔고 왜 내가이 문제를 겪고 있는지 이해하지 못하고있다. 대략 초안 시작 페이지는 www.flynntec.com에 있습니다. 예 오류 : 문서 유형이 요소 문제를 허용하지 않습니다.

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

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 다음 :

<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 을 사용할 수 있습니까? – danludwig

+0

나는 그것을 결코 고려하지 않았다 - 사용하는 적절한 구문은 무엇인가? – jdflynn55

+0

<- 현재 doctype이있는 첫 번째 줄로 넣으십시오. – danludwig

답변

2

당신은 UL 내부에 직접 H3 요소를 가질 수 없습니다 - 이미 유효성 검사 오류의 대부분을 수정해야 ...

2

분명히 오류로 - 그것이 리튬 내에서 할 필요가, 또는 UL 전 상태가 올바르지 않습니다.

<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>에 포함하지 않고 이 내 <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 's 안에 있습니다. 그들은 목록의 바깥에있을 필요가 있습니다.

관련 문제