当前位置:网站首页>移动Web(字体图标、平面转换、颜色渐变)
移动Web(字体图标、平面转换、颜色渐变)
2022-04-23 06:26:00 【GuTaiWEI】
记录一下自己学习的内容,欢迎大家评论与指正。
字体图标
Unionde 引入方法:
- 引入
iconfont.css
文件 - 准备一个标签,给这个标签加一个 iconfont 的类名
- 找到
demo_index.html
复制对应的字体编码 放入标签中
Font class 引入方法:
- 引入
iconfont.css
文件 - 给某个标签添加两个类名
iconfont
icon-xxx
iconfont
目的是告诉这个盒子里面的文字是字体图标。 不是普通的文字。icon-daohangdizhi
, 告诉盒子到底使用哪个小图标。
伪元素显示字体图标
-
引入
iconfont.css
文件 -
给标签添加 伪元素
-
从
demo_index.html
找到文字图标对应的 Unicode值,复制从 e 字母开始值,放到伪元素 content 属性中 -
给为元素添加
font-family
属性 值为iconfont.css
中 font-family 的值注意: 使用伪元素字体图标,一定要声明字体。 font-family: "iconfont"
变形 transform
位移 translate
translate: 可以让盒子沿着x轴或者y轴来移动。
//x,y 可以为百分比和像素值
transform: translate(x, y);
transform: translateX(x);
transform: translateY(y);
- 移动的时候可以写百分比,如果使用的百分比,移动的是盒子 自身的宽度
translate
只设置一个值时,相当于translateX
旋转 rotate
-
rotate: 旋转可以让盒子旋转角度。
//如果是正度数,则是顺时针旋转 //如果是负度数,则是逆时针旋转 transform: rotate(45deg); //一定写单位
-
transform-origin: 设置旋转的中心点位置
transform-origin: right bottom;
-
多形态变形小技巧
//如果需要移动,也需要旋转,则一定先写移动,后写旋转, css属性书写顺序影响代码执行 transform: translate(-50%, -50%) rotate(360deg);
注意:多个值之前用 空格隔开。
缩放 scale
scale: 他是用中心点来进行缩放的,同样他不会影响其他的盒子。
transform: scale(1.2);
scale 会影响元素的层级,需要使用 z-index,z-index 只能作用在定位元素上
渐变 linear-gradient
基本语法:
background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .5))
版权声明
本文为[GuTaiWEI]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_43826202/article/details/118658512
边栏推荐
猜你喜欢
Discussion on arrow function of ES6
Authorization+Token+JWT
SAP PI/PO功能运行状态监控检查
SAP pi / PO rfc2restful publishing RFC interface is a restful example (proxy indirect method)
Reflection on the systematic design of Android audio and video caching mechanism
王者荣耀-unity学习之旅
反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
Authorization+Token+JWT
自定义时间格式(YYYY-MM-DD HH:mm:ss 星期X)
js之节点操作,为什么要学习节点操作
随机推荐
js之函数的两种声明方式
面经的总结
7.子查询
Reflection on the systematic design of Android audio and video caching mechanism
Methods of database query optimization
[hdu6868]Absolute Math(推式子+莫比乌斯反演)
How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)
5. Sql99 standard: internal connection and external connection
[hdu6833]A Very Easy Math Problem(莫比乌斯反演)
The difference and application of VR, AR and MR, as well as some implementation principles of AR technology
[Ted series] how does a habit change my life
[self motivation series] what really hinders you?
MySQL storage engine
3.排序语句
promise all的实现
12. Constraints
Redis connection error err auth < password > called without any password configured for the default user
SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
斐波拉去动态规划
1. View databases and tables