2016-07-22 3 views
1

HTML에서 중첩 목록을 작성하고 https://validator.w3.org에 유효성을 검사하려고합니다. 유효성을 검사 할 때 태그가 어떻게 중첩되는지에 대한 오류가 가득 찼습니다.HTML 스크립트가 올바르게 유효성을 검사하지 않습니다.

<!DOCTYPE html> 
<html lang ="en"> 
<head> 
<meta charset="utf-8"> 
<title>Ex 2</title> 
</head> 
<body> 
<ul> 
<li>Outer-1 
<li>Outer-2</li> 
<ul> 
<li>Inner-1 
<li>Inner-2</li> 
<li>Inner-3</li> 
<ul> 
<li>Deep-1</li> 
</ul> 
</li> 
<li>Inner-4 
<ul> 
<li>Deep-2</li> 
</ul> 
</li> 
</ul> 
</li> 
<li>Outer-3</li> 
</ul> 
<ul> 
<li style = "list-style-type: decimal">Outer-1 
<li style = "list-style-type: decimal">Outer-2</li> 
<ul> 
<li style = "list-style-type: lower-alpha">Inner-1 
<li style = "list-style-type: lower-alpha">Inner-2</li> 
<ul> 
<li style = "list-style-type: lower-roman">Deep-1</li> 
<li style = "list-style-type: lower-roman">Deep-2</li> 
</ul> 
</li> 
</ul> 
</li> 
<li style = "list-style-type: decimal">Outer-3</li> 
<ul> 
<li style = "list-style-type: lower-roman">Inner-3</li> 
</ul> 
</ul> 
</body> 
</html> 

내가 둥지 리 내 UL 태그를해야 말합니다이 (correct semantics for ul in ul) 게시물을 발견하지만이 내가 무엇을 인 원하는 동일한 결과를 제공하지 않는 것으로 확인 유래에 대한 몇 가지 게시물을 통해보고 후 나는 현재 가지고 있지만 또한 그것을 제대로 확인하고 싶습니다. 누구든지 올바른 형식으로 도움을 줄 수 있습니까?

답변

1

<!DOCTYPE html> 
 
<html lang ="en"> 
 
    <head> 
 
    <meta charset="utf-8"> 
 
    <title>Ex 2</title> 
 
    </head> 
 
    <body> 
 
    <ul> 
 
     <li>Outer-1</li> 
 
     <li>Outer-2 
 
     <ul> 
 
     <li>Inner-1 
 
     <li>Inner-2</li> 
 
     <li>Inner-3 
 
     <ul> 
 
      <li>Deep-1</li> 
 
     </ul> 
 
     </li> 
 
     <li>Inner-4 
 
     <ul> 
 
      <li>Deep-2</li> 
 
     </ul> 
 
     </li> 
 
    </ul> 
 
    </li> 
 
    <li>Outer-3</li> 
 
    </ul> 
 
<ul> 
 
    <li style = "list-style-type: decimal">Outer-1</li> 
 
    <li style = "list-style-type: decimal">Outer-2 
 
    <ul> 
 
    <li style = "list-style-type: lower-alpha">Inner-1</li> 
 
    <li style = "list-style-type: lower-alpha">Inner-2 
 
    <ul> 
 
     <li style = "list-style-type: lower-roman">Deep-1</li> 
 
     <li style = "list-style-type: lower-roman">Deep-2</li> 
 
    </ul> 
 
    </li> 
 
    </ul> 
 
    </li> 
 
    <li style = "list-style-type: decimal">Outer-3</li> 
 
</ul>

나는 몇 가지 태그를 수정 한 지금은 잘 작동합니다.

+0

여전히 유효성 검사기에서 유효성을 검사합니다 – xan

+1

마지막 u1에 ">"이 누락되었지만 제대로 작동합니다. 감사합니다. – xan

0

<meta charset="utf-8" />

은 메타 태그는이어야한다?

+0

어쩌면 여전히 오류가 발생합니다. – xan

+0

아니요, OP의 소스는 XHTML이 아닙니다. –

관련 문제