当前位置:网站首页>2D转换模块&&媒体查询
2D转换模块&&媒体查询
2022-07-30 23:33:00 【qq_48639265】
2D转换模块
1. transform: rotate(45deg)
deg代表多少度
2. transform: translate (100px, 0px)
第一个参数:水平方向
第二个参数:垂直方向
3. transform: scale(1.5); transform: scale(0.5,0.5);
第一个参数:水平方向
第二个参数:垂直方向
综合转换连写格式
transform: rotate(45deg) translate(100px, 0px) scale(1.5, 1.5)
形变中心点
transform-origin:
第一个参数:水平方向
第二个参数:垂直方向
取值有三种形式
具体像素
transform-origin: 200px 0px;
百分比
transform-origin: 50% 50%;
transform-origin: 0% 0%;
特殊关键字
transform-origin: center center;
默认情况下所有的元素都是以自己的中心点作为参考来旋转的, 我们可以通过形变中心点属性来修改它的参考点
旋转轴向
transform: rotateZ(45deg); -------默认围绕z轴旋转
围绕z轴旋转
transform: rotateX(45deg);
围绕x轴旋转
transform: rotateY(45deg);
围绕y轴旋转
3D元素视图 perspective
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style> div {
width: 310px; height: 438px; transition: transform 2s; margin: 50px auto; /* 设置3D视图 */ perspective: 500px; } div:hover img {
transform: rotateX(-45deg); } </style>
</head>
<body>
<div>
<img src="../../images/pk.png" alt="">
</div>
</body>
</html>
效果图:
媒体查询
根据设备显示器的特性(如视口宽度、屏幕比例、设备方向:横向或纵向)为其设定css样式,媒体查询由媒体类型和一个或多个检测媒体特性的条件表达式组成。
PC端 1024px
pad端 >768px < 1024px
移动端 <768px
** 使用方法**
<!-- link元素中的CSS媒体查询 -->
<link rel="stylesheet" media="(min-width: 800px)" href="example.css" />
<!-- 样式表中的CSS媒体查询 -->
<style> @media (max-width: 600px) {
.class {
display: none; } } </style>
多条语句
<style> @media screen and (max-width:999px) and (min-width:801px){
div{
font-size: 50px; } } </style>
媒体类型
all | 所有媒体(默认值) |
---|---|
screen | 彩色屏幕 |
打印预览 |
媒体属性
width | 可加max min前缀 |
---|---|
height | 可加max min前缀 |
device-width | 可加max min前缀 |
orientation | portrait竖屏/landscape横屏 |
边栏推荐
猜你喜欢
A detailed explanation: SRv6 Policy model, calculation and drainage
可视化工具Netron介绍
2022中国物流产业大会暨企业家高峰论坛在杭州举办!
Go语学习笔记 - gorm使用 - gorm处理错误 Web框架Gin(十)
flex-direction容器属性
软件测试三阶段,你在哪一步?
Go语学习笔记 - gorm使用 - 事务操作 Web框架Gin(十一)
IJCAI2022教程 | 口语语言理解:最新进展和新领域
抽象类和接口(学习笔记)
Apache Doris series: In-depth understanding of real-time analytical database Apache Doris
随机推荐
2022 Nioke Summer Multi-School Training Camp 1 J Serval and Essay
The difference between ?? and ??= and ?. and || in JS
360核心安全大脑3.0正式发布,构建政企用户的“能力中枢平台”
Chevrolet Trailblazer, the first choice for safety and warmth for your family travel
二叉查找树的定义,查找,插入,删除
#yyds干货盘点# 面试必刷TOP101:判断链表中是否有环
电脑快捷方式图标变白解决方案
从编译的角度来学作用域!
MPI简谈
通过对抗性知识蒸馏压缩深度图神经网络
第十九周进度(了解物联网基础知识)
Manually set transaction commit in mysql
会员生日提前了一天
Summary of BFS questions
(WebFlux)001、如何自定义注解实现功能
In MySQL, the stored procedure cannot realize the problem of migrating and copying the data in the table
游戏商城表建立
实验8(vlan实验)
Calico 网络通信原理揭秘
The performance management method OKR is used by all companies