博客列表 >0322作业

0322作业

 
 原创
2021年03月24日 20:29:28434浏览

选择器分类

id选择器
类选择器
后代选择器
子元素选择器
相邻选择器
伪类选择器

id选择器= #ID名称 css中使用#id{}就可以创建样式
class选择器 .类名 css中使用.类名{}书写
后代 层级 层级 层级 通过空格分级 全选最后一级包含以下的全部子元素
子元素 层级 > 层级 > 层级 > 层级 选中最后一级的所有子元素
相邻选择器 div div+p 选中div>p标签元素
伪类 hover has right active等伪类元素

模块化

css封装到另个css文件内 使用import方法或link引入使用

  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. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. body {
  14. background-color: #f1f1f1;
  15. }
  16. .wrap {
  17. width: 24em;
  18. height: 35em;
  19. background: #ffffff;
  20. margin: auto;
  21. margin-top: 6em;
  22. border-radius: 8px;
  23. box-shadow: 0px 0px 10px 2px rgba(15, 5, 102, 0.075);
  24. }
  25. .top {
  26. height: 25%;
  27. background-color: #f5f7fa;
  28. border-radius: 8px 8px 0 0;
  29. }
  30. .tittle {
  31. text-align: center;
  32. padding-top: 7%;
  33. font-weight: 500;
  34. font-size: 24px;
  35. }
  36. .tips {
  37. color: #8b8e9c;
  38. font-size: 4px;
  39. margin: 10px 40px 50px 40px;
  40. line-height: 18px;
  41. text-align: center;
  42. }
  43. .Mbody {
  44. padding: 0 40px 0 40px;
  45. }
  46. .InputStyle {
  47. width: 100%;
  48. height: 3.5em;
  49. background-color: #f6f7fb;
  50. border: none;
  51. text-indent: 10px;
  52. border-radius: 2px;
  53. margin-bottom: 10px;
  54. }
  55. .Mform {
  56. margin-top: 20px;
  57. }
  58. .login {
  59. margin-top: 30px;
  60. background: linear-gradient(#538af9, #4a73f9);
  61. color: white;
  62. font-size: 14px;
  63. line-height: 0;
  64. box-shadow: 0 5px 10px 3px rgba(14, 26, 202, 0.116);
  65. }
  66. .OperatingArea {
  67. color: #538af9;
  68. font-size: 14px;
  69. margin-top: 0.5em;
  70. }
  71. .ForgotPassword {
  72. margin-left: 13.4em;
  73. }
  74. </style>
  75. </head>
  76. <body>
  77. <div class="wrap">
  78. <div class="top">
  79. <div class="tittle">登录</div>
  80. <div class="tips">
  81. 你可以使用账号登录不同的网站,如百度 阿里 腾讯 都是我公司的旗下网站
  82. </div>
  83. </div>
  84. <div class="Mbody">
  85. <div class="Mform">
  86. <form action="">
  87. <input
  88. type="text"
  89. name="Account"
  90. id="Account"
  91. class="InputStyle"
  92. placeholder="用户名、邮箱、手机"
  93. />
  94. <input
  95. type="password"
  96. name="Account"
  97. id="Account"
  98. class="InputStyle"
  99. placeholder="密码"
  100. />
  101. <input type="submit" value="登录" class="InputStyle login" />
  102. </form>
  103. <div class="OperatingArea">
  104. <span class="RegisterNow">立即注册</span>
  105. <span class="ForgotPassword">忘记密码</span>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </body>
  111. </html>
  112. 325 500
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议