css基础样式.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. a {
  9. color: #000;
  10. /* 取消a标签的默认样式 */
  11. text-decoration: none;
  12. }
  13. a:hover {
  14. color: #f00;
  15. }
  16. ul {
  17. /* 取消无序列表默认样式 */
  18. list-style: none;
  19. }
  20. ul li:hover {
  21. color: #f00;
  22. /* 鼠标变小手 */
  23. cursor: pointer;
  24. }
  25. div {
  26. width: 200px;
  27. height: 200px;
  28. background: #00f;
  29. border: 1px solid #f00;
  30. /* 取消边框 */
  31. border: none;
  32. /* 圆角
  33. border-radius
  34. 50% 变成圆
  35. 左上
  36. border-top-left-radius
  37. 右上
  38. border-top-right-radius
  39. 左下
  40. border-bottom-left-radius
  41. 右下
  42. border-bottom-right-radius
  43. */
  44. border-bottom-right-radius: 10px;
  45. /* border-radius: 50%; */
  46. }
  47. input {
  48. /* 取消input框点击默认样式 */
  49. /* outline: none; */
  50. /* outline: 2px solid #f00; */
  51. outline-width:4px;
  52. outline-style: double;
  53. outline-color: #ff0;
  54. /*
  55. outline:width style color 轮廓
  56. 复合属性
  57. outline-width
  58. outline-style
  59. outline-color
  60. */
  61. }
  62. /*
  63. 伪元素 加上content
  64. ::after 在后面(位置)
  65. ::before 在前面(位置)
  66. css2的语法 :after :before
  67. css3的语法 ::after ::before
  68. */
  69. p::after{
  70. content: "今天天气真好";
  71. color: #f00;
  72. }
  73. p::before {
  74. content: "在前面";
  75. color: #00f;
  76. }
  77. </style>
  78. </head>
  79. <body>
  80. <div></div>
  81. <a href="">今天</a>
  82. <a href="">明天</a>
  83. <a href="">后天</a>
  84. <ul>
  85. <li>1</li>
  86. <li>2</li>
  87. <li>3</li>
  88. </ul>
  89. <input type="text" placeholder="请输入">
  90. <p>这是一段文字</p>
  91. </body>
  92. </html>