批改状态:合格
老师批语:
示例代码
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>注册表单</title></head><body><h2 style="text-align: center;">用户注册</h2><!-- form标签是表单容器 action属性表示服务器接收地址method属性表示请求类型 get:明文发送 post:隐秘发送--><form action="check.php" method="GET" ><!-- fieldset是表单分组 --><fieldset><legend style="text-align: center">必填项</legend><div><!-- label标签用于for属性与文本框id属性为相同值绑定 --><label for="username">账号:</label><!-- input标签表示输入数据的输入字段 text表示文本 name表示服务器上的变量placeholder表示提示文字 required表示此内容必填项 autofocus表示焦点落到输入框中value表示未输入的默认值--><inputtype="text"id="username"name="username"placeholder="不少于11位"requiredautofocusvalue="123"/></div><div><!-- label标签用于for属性与文本框id属性为相同值绑定 --><label for="psw">密码:</label><!-- input标签表示输入数据的输入字段 password表示密码 name表示服务器上的变量placeholder表示提示文字 required表示此内容必填项 --><inputtype="password"id="psw"name="psw"placeholder="不少于11位"required/><!-- 查看已输入的密码 --><buttontype="button"onclick="document.querySelector('#psw').type='text'">显示密码</button></div><div><!-- label标签用于for属性与文本框id属性为相同值绑定 --><label for="email">邮箱:</label><!-- input标签表示输入数据的输入字段 text表示文本 name表示服务器上的变量placeholder表示提示文字 required表示此内容必填项--><input type="email" id="email" name="email"placeholder="abc@email.com" required></div></fieldset><div><!-- 单选文本框中的name值必须完全一样,才能返回唯一值 --><label for="secret">性别:</label><input type="radio" name="gender" id="male" value="male" /><labelfor="male">男</label><input type="radio" name="gender" id="male" value="female" /><labelfor="female">女</label><!-- checked属性代表默认值 布尔属性默认true,不需要值 --><input type="radio" name="gender" id="secret" value="secret" checked /><labelfor="secret">保密</label></div><div><!-- 多选文本框--><label >爱好:</label><input type="checkbox" name="gender" id="travel" value="travel" checked /><labelfor="travel" >旅游</label><input type="checkbox" name="gender" id="shoot" value="shoot" /><labelfor="shoot">摄像</label><!-- checked属性代表默认值 布尔属性默认true,不需要值 --><input type="checkbox" name="gender" id="game" value="game" checked /><labelfor="game">打游戏</label></div><div><!-- 下拉列表 --><select name="level" ><option value="1">铜牌会员</option><option value="2">银牌会员</option><option value="3" selected >金牌会员</option><option value="4">永久会员</option></select></div><div><!-- 自定义下来列表 datalist+input --><label for="">搜索关键字</label><!-- search 搜索框 --><input type="search" name="search" list="keywords"><datalist id="keywords"><option value="html">html </option><option value="css">css </option><option value="js">js </option><option value="php">php </option></datalist></div><button >提交</button><button type="reset">重置</button></form></body></html>

示例代码
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title></head><body><h1 class="a" id="b">今天天气非常好</h1><style>/*css的三种选择器: id,class,标签 *//* 将id,class,:tag ,看成三位数,初始为 0,0,0 *//* 百位 十位 个位id class tag0 0 0 *//* 0 , 0 , 1 */h1 {background-color: yellow;}/* 0 , 0 ,2 */body h1 {background-color: blue;}/* 0 , 0 3 */html body h1 {background-color: cadetblue;}/* 0 , 1 0 */.a {background-color: chocolate;}/* 0 , 1 , 1 */h1.a {background-color: crimson;}/* 0 , 1 ,0 */#b {background-color: cyan;}/* 0, 1 ,1 */#b.a {background-color: lawngreen;}</style></body></html>
示例代码:
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title></head><body><ul class="list"><li>item1</li><li class="item">item2</li><li>item3</li><li>item4</li><li>item5</li></ul><style>/* 子元素:> */.list > li {border: 1px solid yellow;}/* 后代:空格 */.list li {border: 1px solid red;}/* 相邻/下一个元素: + */.list .item + * {background-color: tomato;}/* 所有兄弟 : ~ * */.list .item ~ * {background-color: turquoise;}</style></body></html>
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号