验证问题

发布于 2024-11-04 01:55:54 字数 3814 浏览 0 评论 0原文

使用 w3c 验证器时出现以下错误,为什么?

 Line 54, Column 9: No li element in list scope but a li end tag seen.
                </li><!-- LI Close -->

代码

<!DOCTYPE html>
<html lang="en">
<head>
    <title><?php echo $name; ?> : Nationwide Housemovers</title>
    <link href="<?php echo base_url()?>includes/css/adminstyle.css" rel="stylesheet" type="text/css" media="screen" />
    <link href='http://fonts.googleapis.com/css?family=Josefin+Slab' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="<?php echo base_url() ?>includes/js/ckedit/ckeditor.js"></script>   
</head>
<body>

    <div id ="wrapper">

        <div id="header">

            <h1 id="companyName">Housemovers Ltd </h1>
            <h4 id="companyQuote">""</h4>

        </div>
        <div id ="leftCol">
 <nav>
        <ul>
        <?php if($this->session->userdata('logged_in')): ?>
            <li><?php echo anchor('admin/dashboard', 'Dashboard');?></li>
            <li><a>Edit Pages</a>
                <?php if(is_array($cms_pages)): ?>
                <ul>
                    <?php foreach($cms_pages as $page): ?>
                <li><a href="<?=base_url();?>admin/editpage/index/<?= $page->id ?>/<?php echo url_title($page->name,'dash', TRUE); ?>"><?=$page->name?></a></li>
                    <?php endforeach; ?>

                </ul> <!-- UL Close -->
                <?php endif; ?>
            </li> <!-- Edit Close -->

            <li><a>Gallery</a>
                <ul>
                <li><?php echo anchor('admin/addimage','Add Image');?></li>
                <li><?php echo anchor('admin/deleteimage','Delete Image');?></li>
                </ul>
            </li> <!-- Gallery Close -->

            <li><a>Sales</a>
            <ul>
                <li><?php echo anchor('admin/addsale','Add Sale');?></li>
                <li><a>Edit Sale</a>
                            <?php if(is_array($sales_pages)): ?>
                                    <ul>
                                        <?php foreach($sales_pages as $sale): ?>
                                        <li><a href="<?=base_url();?>admin/editsale/index/<?= $sale->id ?>/<?php echo url_title($sale->name,'dash', TRUE); ?>"><?=$sale->name?></a></li>
                                        <?php endforeach; ?>
                                    </ul>
                                <?php endif; ?>
                                </li><!-- LI Edit Sale Close -->
                </li><!-- LI Close -->
                <li><?php echo anchor('#','Delete Sale');?></li>
            </ul><!-- UL Close -->

            <li><?php echo anchor('admin/home/logout','Log Out');?></li>
        <?php else: ?>
        <?php redirect('admin/home'); ?>
            <?php endif; ?>
        </ul>
 </nav>
        </div><!--leftCol End -->

        <section id="content">

            <?=$content?>

        </section>

        <footer>

            <p>&copy; Houses LTD <?php echo date('Y');?></p>

        </footer>
    </div>

</body>
</html>

I get the following error when using the w3c validator why?

 Line 54, Column 9: No li element in list scope but a li end tag seen.
                </li><!-- LI Close -->

Code

<!DOCTYPE html>
<html lang="en">
<head>
    <title><?php echo $name; ?> : Nationwide Housemovers</title>
    <link href="<?php echo base_url()?>includes/css/adminstyle.css" rel="stylesheet" type="text/css" media="screen" />
    <link href='http://fonts.googleapis.com/css?family=Josefin+Slab' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="<?php echo base_url() ?>includes/js/ckedit/ckeditor.js"></script>   
</head>
<body>

    <div id ="wrapper">

        <div id="header">

            <h1 id="companyName">Housemovers Ltd </h1>
            <h4 id="companyQuote">""</h4>

        </div>
        <div id ="leftCol">
 <nav>
        <ul>
        <?php if($this->session->userdata('logged_in')): ?>
            <li><?php echo anchor('admin/dashboard', 'Dashboard');?></li>
            <li><a>Edit Pages</a>
                <?php if(is_array($cms_pages)): ?>
                <ul>
                    <?php foreach($cms_pages as $page): ?>
                <li><a href="<?=base_url();?>admin/editpage/index/<?= $page->id ?>/<?php echo url_title($page->name,'dash', TRUE); ?>"><?=$page->name?></a></li>
                    <?php endforeach; ?>

                </ul> <!-- UL Close -->
                <?php endif; ?>
            </li> <!-- Edit Close -->

            <li><a>Gallery</a>
                <ul>
                <li><?php echo anchor('admin/addimage','Add Image');?></li>
                <li><?php echo anchor('admin/deleteimage','Delete Image');?></li>
                </ul>
            </li> <!-- Gallery Close -->

            <li><a>Sales</a>
            <ul>
                <li><?php echo anchor('admin/addsale','Add Sale');?></li>
                <li><a>Edit Sale</a>
                            <?php if(is_array($sales_pages)): ?>
                                    <ul>
                                        <?php foreach($sales_pages as $sale): ?>
                                        <li><a href="<?=base_url();?>admin/editsale/index/<?= $sale->id ?>/<?php echo url_title($sale->name,'dash', TRUE); ?>"><?=$sale->name?></a></li>
                                        <?php endforeach; ?>
                                    </ul>
                                <?php endif; ?>
                                </li><!-- LI Edit Sale Close -->
                </li><!-- LI Close -->
                <li><?php echo anchor('#','Delete Sale');?></li>
            </ul><!-- UL Close -->

            <li><?php echo anchor('admin/home/logout','Log Out');?></li>
        <?php else: ?>
        <?php redirect('admin/home'); ?>
            <?php endif; ?>
        </ul>
 </nav>
        </div><!--leftCol End -->

        <section id="content">

            <?=$content?>

        </section>

        <footer>

            <p>© Houses LTD <?php echo date('Y');?></p>

        </footer>
    </div>

</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除→记忆 2024-11-11 01:55:54

还有一个额外的

<li><a>Edit Sale</a>
    <?php if(is_array($sales_pages)): ?>
        <ul>
        <?php foreach($sales_pages as $sale): ?>
        <li>
            <a href="<?=base_url();?>admin/editsale/index/<?= $sale->id ?>/<?php echo url_title($sale->name,'dash', TRUE); ?>"><?=$sale->name?></a>
        </li>
        <?php endforeach; ?>
        </ul>
    <?php endif; ?>
</li><!-- LI Edit Sale Close -->
<!-- Right here you have two closing end tags for <li>-->
</li><!-- LI Close -->

There's an extra </li>

<li><a>Edit Sale</a>
    <?php if(is_array($sales_pages)): ?>
        <ul>
        <?php foreach($sales_pages as $sale): ?>
        <li>
            <a href="<?=base_url();?>admin/editsale/index/<?= $sale->id ?>/<?php echo url_title($sale->name,'dash', TRUE); ?>"><?=$sale->name?></a>
        </li>
        <?php endforeach; ?>
        </ul>
    <?php endif; ?>
</li><!-- LI Edit Sale Close -->
<!-- Right here you have two closing end tags for <li>-->
</li><!-- LI Close -->
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文