1、改变鼠标样式
把鼠标改成自己喜欢的小图片
| *{cursor:url(https://blog-static.cnblogs.com/files/blogs/725648/cursora.ico),auto;} |
2、鼠标选中样式
鼠标选中样式,背景颜色,文字颜色的修改
| |
| ::selection { background:#807dd4; color: #fff;} |
| |
| ::-moz-selection { background:#807dd4; color: #fff; } |
3、自定义页面滚动条
自定义页面滚动条样式,div什么都可以用,将html换成div的class名称即可
| html::-webkit-scrollbar-thumb { |
| height: 40px; |
| border-radius: 16px; |
| background-color: #ccc; |
| } |
| html::-webkit-scrollbar { |
| width: 10px; |
| height: 10px; |
| border-radius: 2px; |
| } |
4、CSS变量
通过样式表中任何位置的关键字重用
| :root { |
| --main-color: #06c; |
| --accent-color: #999; |
| } |
| h1, h2, h3 { |
| color: var(--main-color); |
| } |
| footer span{ |
| color: var(--accent-color); |
| } |
5、解决ios滑动时无缓冲问题
| -webkit-overflow-scrolling: touch; |
6、强行换行css
有时候做页面,测试打一个很长很长的字符或者数字来,文字就会显示在页面外面,这时就需要一个强制换行
| white-space:pre-wrap; |
| white-space:-moz-pre-wrap; |
| white-space:-pre-wrap; |
| white-space:-o-pre-wrap; |
| word-wrap:break-word; |
7、文本溢出显示省略号
width宽度,-webkit-line-clamp要显示几行,自行设置
| width: 200px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; |
8、不能选中文本
user-select
设置不能选中文本
| -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -khtml-user-select: none; user-select: none; |
9、偏移自身50%
| transform: translate(-50%,-50%); |
10、苹果手机底部小横线
| |
| padding-bottom: calc(0 + constant(safe-area-inset-bottom)); |
| padding-bottom: calc(0 + env(safe-area-inset-bottom)); |
11、动画效果
| |
| transition: all 0.15s linear; |
12、投影
| |
| box-shadow: 0 6rpx 22rpx rgb(0 0 0 / 25%); |
13、文字描边
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| .plan-bg2 { |
| |
| font-family: Heavy; |
| |
| font-size: 30px; |
| |
| font-weight: 900; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| color: #fff; |
| |
| } |
| |
| |
| |
14、缩放
15、横向滚动
| |
| 父: |
| white-space: nowrap; |
| overflow-x: auto; |
| 子:{ |
| display: inline-flex; |
| align-items: center; |
| justify-content: center; |
| } |
16、段落缩进前两个字符
17、翻转
| |
| transform:rotateX(180deg); |
18、文字渐变色
| |
| background-image: linear-gradient(to right, #ce25c0, #d6e56e, #ee2cb3, #deae42); |
| -webkit-background-clip: text; |
| color: transparent; |
| display: inline-block; |
| animation: colorflashing-444ad1fa 1.5s ease-in-out infinite; |
| -webkit-animation: colorflashing-444ad1fa 1.5s ease-in-out infinite; |
19、渐变色
| |
| background: linear-gradient(90deg, #ffc046, #ff7d04); |
| background-image: linear-gradient(270deg, #4940AC 0%, #00A38E 100%); |
20、渐变色 背景图共存
| |
| background: url('https://szy-mms.oss-cn-beijing.aliyuncs.com/assets/expert-images/static/images/bg/capital-bg.png') |
| no-repeat center / 100%, |
| linear-gradient(90deg, #ffc046, #ff7d04); |
后期遇到比较不错的,会不断的完善
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南