以下是100种CSS写法,其中某些方法可能需要一定的CSS知识和经验,但它们对于优化和完善网页布局和样式非常有用。
1. #id {} 2. .class {} 3. a {} 4. div {} 5. span {} 6. p {} 7. h1 {} 8. h2 {} 9. h3 {} 10. img {} 11. ul {} 12. ol {} 13. li {} 14. table {} 15. tr {} 16. td {} 17. th {} 18. form {} 19. input {} 20. label {} 21. textarea {} 22. button {} 23. select {} 24. option {} 25. a:hover {} 26. a:visited {} 27. a:active {} 28. a:focus {} 29. div:hover {} 30. div:active {} 31. div:focus {} 32. .class:hover {} 33. .class:visited {} 34. .class:active {} 35. .class:focus {} 36. #id:hover {} 37. #id:visited {} 38. #id:active {} 39. #id:focus {} 40. margin {} 41. padding {} 42. border {} 43. width {} 44. height {} 45. display {} 46. float {} 47. clear {} 48. position {} 49. top {} 50. left {} 51. bottom {} 52. right {} 53. overflow {} 54. z-index {} 55. font-size {} 56. font-weight {} 57. font-family {} 58. line-height {} 59. font-style {} 60. text-transform {} 61. text-decoration {} 62. text-align {} 63. color {} 64. background-color {} 65. background-image {} 66. background-position {} 67. background-size {} 68. background-repeat {} 69. opacity {} 70. box-shadow {} 71. border-radius {} 72. text-shadow {} 73. transform {} 74. transition {} 75. animation {} 76. @media {} 77. @import {} 78. @font-face {} 79. @keyframes {} 80. :before {} 81. :after {} 82. content {} 83. cursor {} 84. visibility {} 85. filter {} 86. cursor:url() {} 87. text-overflow {} 88. white-space {} 89. word-spacing {} 90. letter-spacing {} 91. @support {} 92. @-webkit-keyframes {} 93. @-moz-keyframes {} 94. @-o-keyframes {} 95. @-ms-keyframes {} 96. text-indent {} 97. list-style-type {} 98. list-style-image {} 99. list-style-position {} 100. text-indent {}
以上是100种常见的CSS写法,掌握这些写法将使你在实现页面布局和样式方面更加得心应手。记得在深入学习CSS时,要注重实践和理论相结合。