当前位置:网站首页>【二、移动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
边栏推荐
- 校园流浪猫信息记录和分享的小程序源码
- Go structure
- Information system project manager (2022) - key content: Knowledge Management (15)
- Servlet usage
- Construction and use of FTP server and NFS server
- Null security and exception
- Kingbasees Security Guide for Jincang database -- 5.1. database transmission security
- [mathematical modeling] Based on MATLAB seismic exploration Marmousi model [including Matlab source code, 1977]
- 金仓数据库KingbaseES安全指南--6.2. 身份验证相关的配置文件
- Shanghai Telecom released public computing services and signed the action plan of "Joint Innovation Center for intelligent computing applications" with Huawei and other partners
猜你喜欢

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

Power consumption: leakage power

上班摸鱼打卡模拟器微信小程序源码

Seamless support for hugging face community, colossal AI low-cost and easy acceleration of large model

重要的 SQL Server 函数 - 其他函数

@Requiredargsconstructor annotation

Idea start project MVN command terminal cannot recognize "MVN" item as cmdlet

Fedformer MOE module

Space complexity calculation super full sorting!! (calculation of hand tearing complexity

Advanced architects, 16 common principles of microservice design and Governance
随机推荐
20-Openwrt crond crontab
Idea2022 change the local warehouse and configure Alibaba cloud central warehouse
22 openwrt uses external kernel and kernel_ config
IPC: multi process binder Aidl user guide, including cases
重要的 SQL Server 函数 - 其他函数
Practice and thinking of AI standardization engine in pink client
金仓数据库KingbaseES安全指南--6.2. 身份验证相关的配置文件
【无标题】
H. 265 web player easyplayer realizes webrtc video real-time recording function
2022-7-27 顾宇佳 学习笔记
Fearless of side impact damage, Chery arize 8 fully protects the safety of passengers
Use Baidu developer tool 4.0 to build a dedicated applet IDE
Kingbasees Security Guide for Jincang database -- 4 data access protection
Power consumption: leakage power
Work fishing clock simulator wechat applet source code
Kotlin——函数
.net upload files through boundary
Go structure
[day03] process control statement
H265/HEVC名词解释-- CTU,CTB,CU,CB,TU,PU,TB,PB,LCU,Slice,Tile,Chroma,Luma,I帧,B帧,P帧