File tree 1 file changed +28
-6
lines changed
1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -881,6 +881,16 @@ body{
881
881
}
882
882
```
883
883
884
+ 要避免错误的覆盖:
885
+
886
+ ```
887
+ .m-detail .info{
888
+ font: 14px sans;
889
+ }
890
+ ```
891
+
892
+ > 如果你只是想改字号和字体,然后写成了上面这样,这是错误的写法,因为 ` font ` 复合属性里的其他属性将会被重置为 user agent 的默认值,比如 ` font-weight ` 就会被重置为 ` normal ` 。
893
+
884
894
推荐:
885
895
886
896
```
@@ -931,7 +941,9 @@ body{
931
941
&-hd{
932
942
padding: 5px 10px;
933
943
background: #eee;
934
- .title{background: #eee;}
944
+ .title{
945
+ background: #eee;
946
+ }
935
947
}
936
948
&-bd{
937
949
padding: 10px;
@@ -942,7 +954,9 @@ body{
942
954
}
943
955
&-ft{
944
956
text-align: center;
945
- .more{color: blue;}
957
+ .more{
958
+ color: blue;
959
+ }
946
960
}
947
961
}
948
962
}
@@ -957,14 +971,22 @@ body{
957
971
padding: 5px 10px;
958
972
background: #eee;
959
973
}
960
- .m-detail-hd .title{ background: #eee; }
961
- .m-detail-bd{ padding: 10px; }
974
+ .m-detail-hd .title{
975
+ background: #eee;
976
+ }
977
+ .m-detail-bd{
978
+ padding: 10px;
979
+ }
962
980
.m-detail-bd .info{
963
981
font-size: 14px;
964
982
text-indent: 2em;
965
983
}
966
- .m-detail-ft{ text-align: center; }
967
- .m-detail-ft .more{ color: blue; }
984
+ .m-detail-ft{
985
+ text-align: center;
986
+ }
987
+ .m-detail-ft .more{
988
+ color: blue;
989
+ }
968
990
969
991
> 任何超过3级的选择器,需要思考是否必要,是否有无歧义的,能唯一命中的更简短的写法
970
992
You can’t perform that action at this time.
0 commit comments