Blogger Information
Blog 19
fans 0
comment 0
visits 10841
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
状态伪类与盒模型
牙森江
Original
340 people have browsed it

1.状态伪类选择器

  1. <!DOCTYPE html>
  2. <html lang="en">
  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. <style>
  9. fieldset {
  10. background-color:rgb(213, 246, 213);
  11. width:280px;
  12. }
  13. fieldset>legend {
  14. text-align: center
  15. }
  16. fieldset span {
  17. color: red;
  18. }
  19. fieldset input {
  20. border: none;
  21. outline: none;
  22. border-bottom: 1px solid grey;
  23. padding: 10px;
  24. }
  25. fieldset :focus {
  26. background-color: rgb(123, 221, 144);
  27. }
  28. input[type='radio']:checked + label {
  29. color: red;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <form action="">
  35. <fieldset>
  36. <legend>用户注册表</legend>
  37. <!-- 输入用户框 -->
  38. <label for="user">用户名:</label>
  39. <input type="text" name="" id="user" placeholder="请输入用户名" required>&nbsp;<span>*</span>
  40. <br>
  41. <!-- 输入密码框: -->
  42. <label for="pass">密&emsp;码:</label>
  43. <input type="password" name="" id="" placeholder="请输入密码" required>&nbsp;<span>*</span>
  44. <br>
  45. <!-- 输入邮箱框: -->
  46. <label for="mail">邮&emsp;箱:</label>
  47. <input type="email" name="" id="mail" placeholder="请输入邮箱" required>&nbsp;<span>*</span>
  48. <br>
  49. <label for="secret">性&emsp;别:</label>
  50. <input type="radio" name="gender" id="man"> <label for="man"></label>
  51. <input type="radio" name="gender" id="woman"> <label for="woman"></label>
  52. <input type="radio" name="gender" id="secret"> <label for="secret">保密</label>
  53. </fieldset>
  54. </form>
  55. </body>
  56. </html>

代码效果如下:

" class="reference-link">

2.盒模型五大属性:

  1. <!DOCTYPE html>
  2. <html lang="en">
  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. <style>
  9. .box {
  10. width: 200px;
  11. height: 200px;
  12. background-color: rgb(137, 227, 227);
  13. border: 3px solid red;
  14. margin: 10px 10px;
  15. padding: 10px 10px;
  16. }
  17. /* 盒子大小200*200px,上下距离各10px,边线一边3px,上下6px,一共226px */
  18. </style>
  19. </head>
  20. <body>
  21. <div class="box">
  22. </div>
  23. </div>
  24. </body>
  25. </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