在没有CSS的情况下增加colspan中的字体大小

时间:2015-03-03 04:40:11

标签: html

确定。我获得了编程训练营的前期作业,以便在不使用CSS的情况下设置简单的传记。我们还必须使用我做过的html验证器。现在我无法弄清楚错误的含义。我把我的名字作为表格标题,我在colspan里面使用了h2标签,所以我可以把名字做得更大。验证器说错了,但它在浏览器中显示正常,我不知道如何为验证器修复它。所以这里是代码的snipet与问题。 (第16行是表格边界线18是tr边界,第20行是colspan。)

<!DOCTYPE html>
<html lang ="en">
    <head>
        <meta charset ="utf-8">
        <title>Levi's Biography</title>
    <!-- lines 6 through 11 are simply added for developing the page to a future standard -->
        <link rel="stylesheet" type="text/css"  href="mybio.css">

        <script src="/jquery.js"></script>
        <script type="text/javascript" src="/js/jquery-1.3.1.js"></script>

    </head>

    <body>

          <table border="4px">
            <thead>
                <tr border="3px"> 
                <!-- html validator says lines 16, 18, and 20 are wrong even though browser shows up well. How do i fix this? -->
                  <th colspan="4"><h2>Levi Donaldson</h2></th>
                </tr>
            </thead>

            <tbody>             
                <tr>
                    <td style="font-family:copperplate"><h3>Born</h3></td>
                    <td style="font-family:copperplate"><h3>Grew up</h3></td>
                    <td style="font-family:copperplate"><h3>Hobbies</h3></td>
                    <td style="font-family:copperplate"><h3>Foods</h3></td>
                </tr>
                <tr>
                    <td>Moenci, AZ</td>
                    <td>Mesa, AZ
                        <br>
                    Wasilla, AK
                        <br> 
                    Eagar, AZ
                        <br> 
                    Cliff, NM
                    </td>

                    <td>Quality family time
                        <br> 
                    Traveling
                        <br> 
                    Fishing
                        <br> 
                    Cooking
                        <br> 
                    Passive income streams
                        <br> 
                    Creating things or improving their designs
                    </td>

                    <td>A great steak
                        <br> 
                    Sushi <em>(with scallops if possible)</em>
                        <br> 
                    Brazilian rice and beans
                        <br> 
                    Home grown fruit
                        <br> 
                    Fresh garden veggies and herbs
                        <br> Cheesecake <strong>(but for heavens sake, NO New York style)</strong>
                    </td>
                </tr>
            </tbody>
          </table>

        <img src="http://1.bp.blogspot.com/_b3dSgzaqFKs/SRfDqJxbSOI/AAAAAAAAADc/iNvyqMQqzKs/S220/katie%26levi2+001.jpg" alt="levi wedding" />

    </body> 
</html>

1 个答案:

答案 0 :(得分:0)

因为您已将<!DOCTYPE html>放在文档的顶部,验证程序将使用HTML 5规则对其进行验证。

  1. 在HTML 5中,border属性不再有效。您必须使用css,例如style='border: 1px solid black'

  2. border代码没有TR属性。所以它无效。

  3. 您不应在H2标记内使用TH标记。请改用css。例如:style='font-size: 200%;'

  4. 您可以参考CSS font size property