当前位置:网站首页>【二、移动web网页开发】2D&3D转换与动画、移动端布局、响应式布局
【二、移动web网页开发】2D&3D转换与动画、移动端布局、响应式布局
2022-07-28 04:21:00 【小蜜蜂学爪哇】
2D&3D转换与动画
1.字体图标
2022年6月29日21:48:05
简介


下载

选择需要的图表添加到购物车=》添加至项目=》下载到本地。
使用字体图标


svg上传


2.2D转换-位移
平面转换的概念

位移transform:translate



定位盒子居中
【使用translate快速实现绝对定位的元素居中效果】
之前的写法:
使用平面转换的位移写法:
案例-双开门


3.2D转换-旋转+缩放
旋转transform:rotate


转换原点transform-origin

多重转换
多重转换技巧:transform:translate() rotate();
缩放transform:scale


案例-缩放



【注意点-层叠性】
4.渐变linear-gradient
2022年6月30日15:19:54
案例-渐变




综合案例


.txt也可以相对于a进行定位。



5.3D转换-位移和透视
空间转换简介

空间位移translate3d

透视属性perspective,800-1200



6.3D转换-旋转+立体呈现
空间旋转transform:rotateX

transform:rotateX/rotateY/rotateZ
左手法则

立体呈现transform-style

使子元素处于真正的3d空间。
7.3D导航案例








首页和index英文重叠在一起:
橙色盒子旋转90度:
橙色盒子向Z轴移动(视线方向):

绿色盒子向前移动:

立方体旋转:(用左手法则确定旋转的角度正负数:x轴,大拇指方向为右,4指方向为正数)
注释掉辅助代码:
8.空间转换-缩放

这种效果用的不多。
9.CSS3动画
简介

from-to


百分比

动画复合属性-延长时间、重复次数


动画方向、执行完毕时的状态

动画拆分写法



逐帧动画



多组动画



综合案例-走马灯



移动端布局
1.移动端基础知识


分辨率

【不管pc端还是移动端都是参考逻辑分辨率去书写代码的。】
视口
【视口】:能够让网页的宽度等于逻辑分辨率的尺寸(设备的宽度)。
没有视口标签,网页的宽度为980px。
二倍图
750px宽的图。写网页以二倍图居多。
设计师给一个750px的图,写代码时还是要参照375px的图去写。以375px去测量尺寸。
百分比布局(流式布局)





2.Flex伸缩布局
简介


不会脱标。
Flex布局模型构成

【添加了display:flex 的 父级叫:弹性容器。里面的子级叫弹性盒子。】
主轴对齐方式:justify-content
【在Flex布局模型中,调节主轴或侧轴的对齐方式来设置盒子之间的间距。】
- space-between

- space-evenly

- space-around


侧轴对齐方式:align-items

- 垂直居中的效果



- 变为默认值。

- 将子级盒子的高度注释掉:


Stretch是拉伸,为默认值。(如果子级盒子有高度,就不会生效。测试的时候需要去掉子级盒子的高度。)
验证是否为默认值,注释掉,发现子级盒子还是会沿着侧轴铺满。
单独控制某个盒子侧轴对齐方式:align-self



弹性盒子尺寸特点

- 子级盒子没有给高,默认会拉伸:

由于第二个子级盒子添加了侧轴居中效果,它的高度为内容的高度。
如果宽度也没有,就会由内容撑开。

弹性伸缩比
【使用flex属性修改弹性盒子的伸缩比。】


修改主轴方向:flex-direction


主轴方向和对齐方式
【1.先确定主轴方向;2、再选择对应的属性实现主轴或侧轴的对齐方式】
弹性盒子换行:flex-wrap


调整行对齐方式:align-content
没有space-evenly。其他的和justify-content基本相同(center、space-around、space-between)。
3.rem移动端适配
2022年7月1日19:27:27

基本使用
【首先要保证HTML标签有字号】
媒体查询


【小括号里面表达的意思是:检测设备的宽。】
测试上面的媒体查询效果时将电脑的分辨率设置为100%
移动适配

布局流程

flexible移动适配


4.Less

简介

注释

单行注释只能存在于Less文件,只能将多行注释渲染到css文件中。
计算


嵌套
【快速生成后代选择器】

变量


导入

导出-插件配置


导出-单独路径

禁止导出

5.vw / vh


vw-移动适配
【目标:实现在不同宽度的设备中,网页元素尺寸等比例缩放效果。】

vh-移动适配

响应式布局
1.媒体查询
max-min-width


书写顺序


完整写法(了解)

关键词:and、only、not

Link写法

隐藏





让.left和.main横着排列。
出现这种情况是因为:盒子为弹性盒子
解决:
表示除去左边.left,父级剩余的宽度为.main盒子的宽度。即保证.left盒子的宽度是300px。

2.Bootstrap
边栏推荐
- 关系数据库事务中的对象锁定
- Use Baidu developer tool 4.0 to build a dedicated applet IDE
- MATLB | location and constant volume IEEE30 node implementation of distributed energy
- Detailed explanation of pl/sql parameters ("box model")
- Important SQL server functions - date functions
- [reach out to Party welfare] the easiest way to scan the H5 page in wechat
- 【day03】流程控制语句
- glusterfs 文件未挂载,权限: r-s
- Applet form-2
- Fedformer MOE module
猜你喜欢

Detailed explanation of pl/sql parameters ("box model")

Use Baidu developer tool 4.0 to build a dedicated applet IDE

功耗:Leakage Power

openpose的一些个人理解

Un7.27: common commands of redis database.

校园流浪猫信息记录和分享的小程序源码

Construction and use of FTP server and NFS server

H265/hevc noun explanation -- CTU, CTB, Cu, CB, Tu, PU, TB, Pb, LCU, slice, tile, chroma, luma, I frame, B frame, P frame

XML file usage and parsing

《Intel Arria 10 Avalon-MM DMA Interface for PCI Express Solutions User Guide》文档学习
随机推荐
The unsatisfied analysis of setup and hold timing is the solution
C语言初阶——循环语句(while,for,do while)
Password key hard coding check
Cookies and session
上班摸鱼打卡模拟器微信小程序源码
金仓数据库KingbaseES安全指南--5.2. 数据完整性保护
MATLB | location and constant volume IEEE30 node implementation of distributed energy
Detailed explanation of pl/sql parameters ("box model")
Kingbasees Security Guide for Jincang database -- 5.1. database transmission security
Un7.27: how to successfully build a ruoyi framework project in idea?
26 openwrt port forwarding DMZ UPnP
H. 265 web player easyplayer realizes webrtc video real-time recording function
VAE generation model (with VAE implementation MNIST code)
IPC: multi process binder Aidl user guide, including cases
The State Administration of market supervision exposes typical cases of food safety
RN interface jump description
[Niuke] find 1+2+3+... +n
What to do when encountering slow SQL? (next)
Campus stray cat information recording and sharing applet source code
glusterfs 文件未挂载,权限: r-s