index.css 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. @charset "UTF-8";
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. list-style: none;
  6. text-decoration: none;
  7. box-sizing: border-box;
  8. }
  9. /*
  10. 多行注释
  11. .sass .scss
  12. sass格式会省略花括号和分号 所以常用scss存储
  13. */
  14. /*
  15. 混合宏
  16. @mixin 声明
  17. @include 调用
  18. */
  19. /*
  20. 继承
  21. 声明方式:已存在的基类
  22. .class{}/.xxx{}
  23. 调用:@extend
  24. */
  25. .vase {
  26. font-size: 20px;
  27. color: purple;
  28. }
  29. /*
  30. 占位符
  31. %placeholder
  32. 声明:%xxxx
  33. 调用:@extend
  34. */
  35. /*
  36. 函数:
  37. @function 函数名(形参) { @return xx }
  38. 函数名(实参)px
  39. */
  40. /*
  41. 操作符:
  42. +:前后单位必须统一
  43. -:前后需要空格
  44. *:只允许一个数值带单位
  45. /:在括号中进行运算 后面拼接单位
  46. 颜色:颜色值分段运算
  47. */
  48. .box {
  49. width: 600px;
  50. height: 400px;
  51. font-size: 30px;
  52. border: 3px solid red;
  53. background: yellow;
  54. }
  55. h1 {
  56. color: blue;
  57. }
  58. h2 {
  59. color: blue;
  60. }
  61. ul {
  62. overflow: hidden;
  63. }
  64. ul li {
  65. float: left;
  66. margin-left: 5px;
  67. border-bottom: 2px solid #f00;
  68. }
  69. ul li a {
  70. color: #000;
  71. font-size: 40px;
  72. font-weight: bold;
  73. }
  74. ul li a:hover {
  75. color: red;
  76. }