0

由于某种原因,此 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" lang="en">
    <head>
        <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
        <title>Gallery</title>
        <!--
        <link rel="stylesheet" type="text/css" href="gallery.css"/>
        Note: use if stylesheet is separated from main project
        I am embedding the CSS so it is easier to send
        -->
        <!--
        <script type="text/javascript" src="gallery.js"></script>
        Note: use if javascript is separated from main project
        I am embedding the JS so it is easier to send
        -->
        <style>
            /* CSS */
            #topbar {}
            #selection {border: 3pt solid red;}
        </style>
        <script type="text/javascript">
            // Javascript
        </script>
        <!-- JQuery -->
        <script src="http://code.jquery.com/jquery-1.8.1.min.js" type="text/javascript"/>
    </head>
    <body>
        <div id="topbar">
            <table id="selection">
                <tr>
                    <td>Test1</td>
                </tr>
            </table>
        </div>
    </body>
</html>

节目中什么都没有body!我什至尝试在其中随机粘贴<p>一些文字,但没有出现。问题是什么?

4

1 回答 1

8

您需要关闭<script>标签。自闭标签对元素无效<script>

<script src="http://code.jquery.com/jquery-1.8.1.min.js" type="text/javascript"></script>
于 2012-09-19T00:56:18.390 回答