根据下图,编写HTML结构。要求:遵循xHTML 1.0规范且符合Web语义。
<!DOCTYPE html > <html xmlns="http://www.w3.org/1999/xhtml"> <head lang="en"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title></title> <style> dt{font-weight: bold} </style> </head> <body> <form action=""> <section> <dl> <dt>您的基本信息</dt> <dd> <span>姓名:</span> <input type="text"> </dd> <dd> <span>性别:</span> <select name="sex"> <option value="1" selected="selected">女</option> <option value="2">男</option> </select> </dd> </dl> </section> <section> <dl> <dt>设置密码</dt> <dd> <span>密码:</span> <input type="password"> </dd> <dd style="text-indent: -2em"> <span>再输一遍:</span> <input type="password"> </dd> </dl> <dl> <dd> <input type="submit" value="确定"> <input type="button" value="取消"> </dd> </dl> </section> </form> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style> *{ margin: 0; padding: 0; } .main{ width: 300px; height: 300px; border: 1px solid #000; } .main h3{ padding-top: 15px; margin-bottom: 10px; padding-left:10px; } .info,.pwd{ padding-left: 45px; } .s1{ margin-left: 40px; margin-right: 10px; } .again{ margin-left: -30px; } input{ margin-bottom: 15px; } </style> </head> <body> <div class="main"> <h3>您的基本信息</h3> <div class="info"> 姓名:<input type="text"><br> 性别:<select> <option>男性</option> <option>女性</option> </select> </div> <h3>设置密码</h3> <div class="pwd"> 密码:<input type="password"><br> <span class="again">再输一遍:</span><input type="password" ><br> <input type="submit" value="提交" class="s1"> <input type="reset" value="取消"> </div> </div> </body> </html>