Blogger Information
Blog 19
fans 0
comment 0
visits 9864
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
表单、内联框架及css练习
newbie
Original
555 people have browsed it

登录器练习


代码

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>细说表单(重点)</title>
  8. </head>
  9. <body>
  10. <!-- method: 提交类型,提交数据以?k=y&k=y查询字符串添加到url中 -->
  11. <form action="check.php" method="post">
  12. <div>
  13. <!-- type, name, value -->
  14. <label for="username">用户名:</label>
  15. <!-- label.for = input.id -->
  16. <!-- autofocus: 布尔属性 -->
  17. <input type="text" id="username" name="username" value="admin" placeholder="至少8位" autofocus required />
  18. </div>
  19. <div>
  20. <label for="psw">密码:</label>
  21. <input type="password" id="psw" name="password" value="123" placeholder="数字+字母" required />
  22. </div>
  23. <div>
  24. <label for="my-email">邮箱:</label>
  25. <input type="email" id="my-email" name="email" value="" placeholder="a@email.com" required />
  26. </div>
  27. <!-- 单选按钮 -->
  28. <div>
  29. <label for="male">性别:</label>
  30. <!-- 所有input.name 必须相同 -->
  31. <input type="radio" name="gender" id="male" checked /><label for="male"></label>
  32. <input type="radio" name="gender" id="female" /><label for="female"></label>
  33. </div>
  34. <!-- 复选框 -->
  35. <div>
  36. <label for="male">爱好:</label>
  37. <!-- 所有input.name 必须是一个数组格式 -->
  38. <input type="checkbox" name="hobbies[]" id="game" checked /><label for="game">游戏</label>
  39. <input type="checkbox" name="hobbies[]" id="programmer" checked /><label for="programmer">编程</label>
  40. <input type="checkbox" name="hobbies[]" id="shoot" /><label for="shoot">摄影</label>
  41. </div>
  42. <!-- 下拉列表 -->
  43. <!-- select.name, option.value , name,value属性不在同一个标签中 -->
  44. <label for="user">会员:</label>
  45. <select name="user" id="user">
  46. <option value="1">金牌会员</option>
  47. <option value="2">银牌会员</option>
  48. <option value="3" selected>铜牌会员</option>
  49. <option value="4">木牌会员</option>
  50. </select>
  51. <div>
  52. <!-- 多行文本框 -->
  53. <textarea name="" id="" cols="30" rows="10"></textarea>
  54. </div>
  55. <div>
  56. <button>提交</button>
  57. </div>
  58. </form>
  59. </body>
  60. </html>

代码效果图


内联框架练习


代码

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <style type="text/css">
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. .liftbox{
  15. width:80px;
  16. height:510px;
  17. background-color:beige;
  18. float: left;
  19. }
  20. .headbox{
  21. width:1265px;
  22. height:50px;
  23. background-color: skyblue;
  24. /* float: left; */
  25. }
  26. li{
  27. text-align: center;
  28. margin: 25px auto;
  29. }
  30. iframe{
  31. width: 1170px; ;
  32. height: 510px;
  33. }
  34. a:link{
  35. color: black;
  36. text-decoration: none;
  37. }
  38. </style>
  39. <body>
  40. <div class="headbox";><h1>许小可网站管理后台系统</h1></div>
  41. <div class="liftbox";><ul>
  42. <hr>
  43. <li><a href="https://sports.sina.com.cn/nba/" target="boxiframe">测试按钮</a></li>
  44. <hr>
  45. <li><a href="https://sports.sina.com.cn/nba/" target="boxiframe">测试按钮</a></li>
  46. <hr>
  47. <li><a href="https://sports.sina.com.cn/nba/" target="boxiframe">测试按钮</a></li>
  48. <hr>
  49. <li><a href="https://sports.sina.com.cn/nba/" target="boxiframe">测试按钮</a></li>
  50. <hr>
  51. <li><a href="https://sports.sina.com.cn/nba/" target="boxiframe">测试按钮</a></li>
  52. <hr>
  53. </ul></div>
  54. <iframe name="boxiframe" src="https://www.sina.com.cn/" frameborder="0" scrolling="no"></iframe>
  55. </body>
  56. </html>

代码效果图


CSS优先级练习


代码

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. </head>
  9. <style type="text/css">
  10. .box1{
  11. color: red;
  12. font-size: 5px;
  13. }
  14. *{
  15. color: blue;
  16. font-size: 15px;
  17. margin: 0;
  18. padding: 0;
  19. }
  20. span{
  21. color: aqua;
  22. font-size: 25px;
  23. }
  24. .sclass{
  25. color: chartreuse;
  26. font-size: 35px;
  27. }
  28. #sid{
  29. color: crimson;
  30. font-size: 45px;
  31. }
  32. .sclass2{
  33. color:hotpink !important;
  34. }
  35. </style>
  36. <body>
  37. <div class="box1"><p>子元素会继承父元素的样式</p></div>
  38. <div class="box1"><span>通配符选择器的优先级大于继承样式的优先级</span></div>
  39. <div class="box1"><span>html标签选择器的优先级大于通配符选择器</span></div>
  40. <div class="box1"><span class="sclass">类选择器的优先级大于标签选择器</span></div>
  41. <div class="box1"><span class="sclass" id="sid">id选择器的优先级大于类选择器</span></div>
  42. <div class="box1"><span class="sclass" id="sid" style="color: black;font-size: 55px">行内样式的优先级大于id选择器</span></div>
  43. <div class="box1"><span class="sclass2" id="sid" style="color: black;font-size: 55px">!important优先级最高可以覆盖行内样式</span></div>
  44. </body>
  45. </html>

代码效果

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post