HTML 示例XHTML表单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML 示例XHTML表单相关的知识,希望对你有一定的参考价值。

<form action="" method="post">
    <fieldset>
        <legend>Registration Form</legend>
        <p class="alert">Alert Message</p>
        <p><label for="name">Name:</label> <input type="text" name="name" id="name"/></p>
        <p class='error'><label for="email">Email:</label> <input type="text" name="email" id="email" /> <span>(you will have to verify your email address, so use a real one)</span></p>
        <p><label for="password1">Password:</label> <input type="password" name="password1" id="password1" /></p>
        <p><label for="password2">Confirm Password:</label> <input type="password" name="password2" id="password2" /></p>
        <p><label for="tos" for="tos">Terms of Service:</label> <div class="message" id="tos">
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        </div></p>
        <p><label for="agree"> </label> <input type="checkbox" name="agree" id="agree" /> I have read and agree to the Terms of Service</p>
        <p><label for="btnsubmit"> </label><input type="submit" value="Register" name="btnsubmit" id="btnsubmit" /></p>
        <p></p>
    </fieldset>
</form>

HTML表单

技术分享
 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 5 <title>无标题文档</title>
 6 </head>
 7 
 8 <body>
 9 <form>
10 账号:<input type="text" value=""/><br />
11 
12 密码:<input type="password" value="" /><br />
13 备注<textarea cols="35" rows="5"></textarea><br />
14 <input type="submit" value="提交" /><br />
15 <input type="reset" value="重置" /><br />
16 <input type="button" value="登陆" /><br />
17 <input type="image" src="wallpaper_a211337.jpg" width="500" /><br />
18 <input type="radio"  name="sex"/><br />
19 <input type="radio"  name="sex"/><br />
20 <input type="checkbox"  checked="checked" disabled="disabled"/>可乐<br />
21 <input type="checkbox" />百事可乐<br />
22 <input type="checkbox" />崂山可乐<br />
23 <input type="file" /><br />
24 <select size="1">
25 <option value="">汉堡</option>
26 <option>鸡米花</option>
27 <option selected="selected">鸡腿</option>
28 </select>
29 
30 </form>
31 </body>
32 </html>
View Code

技术分享

以上是关于HTML 示例XHTML表单的主要内容,如果未能解决你的问题,请参考以下文章

html表单练习

第三章 XHTML 表单

网页表单制作

表单练习——邮箱注册

表单与框架

图片热点,网页划区,form表单