如果文档宽度小于 300 像素则修改背景颜色(background-color):
@media screen and (max-width: 300px) {
body {
background-color:lightblue;
}
}
css中cursor属性cursor:pointer:鼠标显示小手字样。
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box; 设置宽或者高是百分比时,包含padding和margin。
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */,规定两个并排的带边框的框
css中:after或者:before设置在之前或者之后设置内容。
h1 {text-decoration:overline}
h2 {text-decoration:line-through}
h3 {text-decoration:underline}
h4 {text-decoration:blink}文本修饰下划线的样式
:last-of-type设置最后元素的属性。
[class*= col-] 代表包含 col- 的类名 ,比如说 col-md-4 ,demo-col-2(这个是虚构的)等都可以匹配到。
[class^=col-] 代表 以 col- 开头的类名,比如说 col-md-4
[class$=col-] 代表以 col- 结尾的类名
2、文本对齐:text-align: justify; text-align-last: right;

本文深入探讨了CSS中鲜为人知但极其实用的样式技巧,包括媒体查询、cursor属性、box-sizing属性、伪元素:before和:after的使用、文本修饰及选择器高级用法。这些技巧将帮助前端开发者提升网页布局和样式的精确控制。
1141

被折叠的 条评论
为什么被折叠?



