我在验证页面时遇到问题

时间:2010-07-31 12:15:04

标签: html validation

我在验证我的页面严格时遇到问题1.任何人都可以帮助我吗?它一直在显示:

  
      
  • 第48行,第4列:文档类型不允许元素“h2”;假设缺少“li”开始标记

    <h2>Current job vacancies</h2>
    
  •   
  • 第60行,第6列:用于结束标记 “li” 被省略,但OMITTAG NO指定

    </div>
    
         

    你可能忽略了关闭一个元素,或者你可能想要“自我关闭”一个元素,也就是说,以“/>”而不是“>”结束它。

  •   
  • 第48行,第1列:开始标记在这里

    <h2>Current job vacancies</h2> 
    
  •   
  • 第60行,第6列:省略了“ul”的结束标记,但指定了OMITTAG NO

    </div>
    
         

    你可能忽略了关闭一个元素,或者你可能想要“自我关闭”一个元素,也就是说,以“/>”而不是“>”结束它。

  •   
  • 第45行,第37栏:开始标记在这里

    <a href="#">Job Vacancies</a> <ul id="jobvacancies">
    
  •   

这是我的页面:

1.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2.<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3.<head>
4.<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
5.<title>Royal Aura club and Restaurant</title>
6.<link rel="stylesheet" type="text/css" href="restyle.css" />
7.</head>
8.
9.<body>
10.
11.
12.<div id="main">
13.
14.
15.<div id="commonlinksbar">
16.|<a class="linker "href="#">about us</a>|
17.<a class="linker "href="#">contact us</a>| 
18.<a class="linker "href="sitemap.html">site map</a>|
19.<a class="linker "href="#">copyright</a>|
20.
21.</div>
22.
23.
24.
25.
26.
27.<div id="header"> 
28.<img class="logo" src="relogo.jpg"alt="auramayfair logo" width="87" height="98" />
29.<h1> Royal Aura club and Restaurant</h1>
30.
31.<div id="nav">
32.<p><a href="index.html">HOME</a><a href="restaurant.html">RESTAURANT</a> <a href="#">GALLERY</a><a href="#">GUEST LIST</a><a href="jobvacancies.html">JOB VACANCIES</a></p>
33.</div> 
34.
35.
36.
37.
38.
39.
40.<div id="content">
41.
42.<div id="breadcrumbs">
43.<a href="index.html">Home</a> >
44.
45.<a href="#">Job Vacancies</a> <ul id="jobvacancies">
46.
47.
48.<h2>Current job vacancies</h2>
49.<p>Royal aura club and restaurant are currently recruiting people to join our friendly atmosphere.</p> 
50.
51.<p>Chef - Skilled Cook with experience in traditional Pan Asian cooking required. The successful candidate will be responsible for all domestic cooking; preparing and producing a range of appetizing meals. The successful candidate will have previous experience within a similar role and will possess natural enthusiasm and a strong passion for food.</p>
52.
53.<hr />
54.
55.<p>Bar staff- Experienced Bar Staff are needed for regular 5-8 hour shifts Fridays and Saturdays. We are looking for someone with previous bar experience, cash handling experience and excellent customer services skills are essential, as is a well-presented appearance and polite manner.</p>
56.
57.
58.<p>Applicants should send their CV with a covering letter to:<a href="mailto:royalaura@hotmail.com">jobs@royalaura.com</a></p>
59.
60.</div>
61.</div>
62.<div id="footer">
63.<p> Copy Right Royal Aura Club 2006</p>
64.</div> 
65.
66.</div>
67.</div>
68.</body>
69.</html>

这是新代码;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Royal Aura club and Restaurant</title>
<link rel="stylesheet" type="text/css" href="restyle.css" />
</head>
<body>

<div id="main">


        <div id="commonlinksbar">
    |<a class="linker "href="#">about us</a>|
     <a class="linker "href="#">contact us</a>|                                                         
     <a class="linker "href="sitemap.html">site map</a>|
     <a class="linker "href="#">copyright</a>|


    </div>




<div id="header">   
<img class="logo" src="relogo.jpg"alt="auramayfair logo" width="87" height="98" />
<h1> Royal Aura club and Restaurant</h1>

<div id="nav">
     <p><a href="index.html">HOME</a><a href="restaurant.html">RESTAURANT</a> <a href="#">GALLERY</a><a href="#">GUEST LIST</a><a href="jobvacancies.html">JOB VACANCIES</a></p>
   </div>       






        <div id="content">

                    <div id="breadcrumbs">
                    <a href="index.html">Home</a> >

                    <a href="#">Job Vacancies</a> <div id="jobvacancies">




<div id="jobs">
<h2>Current job vacancies</h2>
<p>Royal aura club and restaurant are currently recruiting people to join our friendly atmosphere.</p>  
<p>Chef - Skilled Cook with experience in traditional Pan Asian cooking required. The successful candidate will be responsible for all domestic cooking; preparing and producing a range of appetizing meals. The successful candidate will have previous experience within a similar role and will possess natural enthusiasm and a strong passion for food.</p>

<hr />

<p>Bar staff- Experienced Bar Staff are needed for regular 5-8 hour shifts Fridays and Saturdays. We are looking for someone with  previous bar experience, cash handling experience and excellent customer services skills are essential, as is a well-presented appearance and polite manner.</p>

<p>Applicants should send their CV with a covering letter to:<a href="mailto:royalaura@hotmail.com">jobs@royalaura.com</a></p>



</div>
    <div id="footer">
    <p> Copy Right Royal Aura Club 2006</p>
    </div> 

</div>
</div>
</body>
</html>

3 个答案:

答案 0 :(得分:6)

您有一个无序列表开头标记:

<ul id="jobvacancies">

您之后有<h2>

<h2>Current job vacancies</h2>

但缺少<li><ul>中的所有元素也必须位于<li>内。

答案 1 :(得分:0)

您打开了无序列表<ul>,但从未将列表项<li>放入其中。此外,您永远不会关闭<ul>元素。

也许你想创建另一个div?

答案 2 :(得分:0)

如果您不希望页面拉伸,那么我建议您更改

的高度和宽度属性
 <div id="content">

并删除

<ul> 

完全。 BTW哪种方式可以拉伸?