段落没有显示

时间:2017-09-09 05:46:09

标签: html html-select

我正在关注Jon Duckett的初学者书。 出于某种原因,一段内容包含"以MP3格式上传您的歌曲"加载网站时没有显示。但其他段落按预期工作。请帮忙。

Blockquote

<!DOCTYPE html>
<html>
<body>
    <form action="http://www.example.com/login.php">
        <p>
            Username:<input type="text" name="username" maxlenth="30" />
        </p>
        <p>
            Password:<input type="password" name="password" maxlength="30" />
        </p>
        <p>
            What did you think of this gig?<textarea mame="comments" cols="20" rows="4">Enter your comments...</textarea>
        </p>
        <p>
            Please select your favorite genre:
            <br />
            <input type="checkbox" name="genre" value="Rock" checked="checked" />Rock
            <input type="checkbox" name="genre" value="Pop" />Pop
            <input type="checkbox" name="genre" value="Jazz" />Jazz
            <br />
        </p>
        <p>
            <select name="device">
                <option value="iPod">Ipod</option>
                <option value="radio">Radio</option>
                <option value="computer">Computer</option>
        </p>

        </form>

        <form action="http://www.example.com/upload.php" method="action">
            <br />
            <p>Upload your song in MP3 format</p>
            <input type="file" name="user-song" /><br />
            <input type="submit" value="Upload" />
        </form>
    </body>
</html>

2 个答案:

答案 0 :(得分:4)

您错过了设备<select>

的结束标记
 <select name="device">
        <option value="iPod">Ipod</option>
        <option value="radio">Radio</option>
        <option value="computer">Computer</option>
</select> <!-- missed this one -->

答案 1 :(得分:1)

</select>标记添加到设备部分。

<html>
<body>
    <form action="http://www.example.com/login.php">
        <p>
            Username:<input type="text" name="username" maxlenth="30" />
        </p>
        <p>
            Password:<input type="password" name="password" maxlength="30" />
        </p>
        <p>
            What did you think of this gig?<textarea mame="comments" cols="20" rows="4">Enter your comments...</textarea>
        </p>
        <p>
            Please select your favorite genre:
            <br />
            <input type="checkbox" name="genre" value="Rock" checked="checked" />Rock
            <input type="checkbox" name="genre" value="Pop" />Pop
            <input type="checkbox" name="genre" value="Jazz" />Jazz
            <br />
        </p>
        <p>
            <select name="device">
                <option value="iPod">Ipod</option>
                <option value="radio">Radio</option>
              <option value="computer">Computer</option>
                // Add close tag.
              </select>
        </p>

        </form>

        <form action="http://www.example.com/upload.php" method="action">
            <br />
            <p>Upload your song in MP3 format</p>
            <input type="file" name="user-song" /><br />
            <input type="submit" value="Upload" />
        </form>
    </body>
</html>