- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
比较以下两个代码片段-
.box {
width: 100px;
height: 100px;
background-color: red;
display: inline-block;
}
.box1 {
margin: 100px;
transform: skew(30deg);
}
<div class="box box1"></div>
.box {
width: 100px;
height: 100px;
background-color: red;
display: inline-block;
}
.box2 {
transform: matrix(1, 0, 30, 1, 0, 0);
}
<div class="box box2"></div>
在第一个代码片段中我使用了 transform: skew(30deg);
在第二个中我使用了 transform: matrix(1,0,30,1,0,0);
正如您在 matrix()
中看到的那样函数我保留了除 skewX()
之外的所有参数的默认值我将其更改为 30
。其工作方式应类似于 skew(30deg)
根据我的假设。由于文档说 matrix()
采用如下参数:
matrix( scaleX(), skewY(), skewX(), scaleY(), translateX(), translateY() );
如果您运行上面的代码片段,那么您会发现不同的输出。为什么它们不一样?正如我的假设所说,它应该相等,因为我使用了 skewX(30deg)
对于这两种情况。
如何matrix()
功能真的有效吗?
scaleX()
使用什么单位, skewY()
, skewX()
, scaleY()
, translateX()
, translateY()
在矩阵函数中?如transform: skew(30deg);
和transform: matrix( skewX(30) );
不要给出相同的输出。
最佳答案
矩阵的使用并不像你想象的那么容易。我们不添加 Angular ,而是添加 Angular 正切:
.box {
width: 100px;
height: 100px;
background-color: red;
display: inline-block;
transform: skew(30deg);
}
.box2 {
transform: matrix(1, 0, .577, 1, 0, 0);
}
<div class="box"></div>
<div class="box box2"></div>
您可以在规范中找到更多详细信息:https://www.w3.org/TR/css-transforms-1/#interpolation-of-2d-matrices
您还可以使用 skew(30deg)
检查元素的计算值以查看矩阵值:
关于html - 为什么要变换 : skew(30deg); is not same as transform : matrix(1, 0,30,1,0,0);?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68494403/
我想创建一个带有度数符号的字符串资源。 例如: °C 但这会产生解析错误。 有办法吗? 谢谢, 米奇 最佳答案 您可以使用下面的 unicode 来显示摄氏度的符号。 \u2103 关于And
有人可以向我解释一下 CSS rotation cross browser with jquery.animate() 中的 $({deg: 0}) 的含义吗? ? 例如 $({deg: 0}).an
当我在 css 中处理一些图片布局时,我想到了在我的图像上添加一个框阴影。问题是在互联网上的任何地方,或者根据我自己的知识,我都无法找到我的问题的答案。 在这里你可以看到我想要用 CSS3 框阴影插入
我以前从来没有听说过这个,或者我可能以其他方式听说过? 上下文是,对于邻接表,列出与u相邻的所有顶点的时间是Θ(deg(u))。 同理,判断是否(u,v)∈E的时间为O(deg(u))。 如果邻接表的
假设我有一个 div,它应用了 transform: rotate(15deg) 的 CSS 规则。如果我使用 JQuery 读取元素的计算 CSS 变换,我会看到浏览器已将 rotate(15deg
我正在使用 javax.mail.1.4.4 并且我已经将地址设置为 **MimeMessage mime = new MimeMessage(session) mime.from = new Int
有谁知道如何或拥有将 GPS 值从十进制转换为 DMS(度-分-秒)格式的 Android 功能? 最佳答案 看看类android.location.Location . 静态方法 convert(d
如果我只是输入标签值或其他地方 ™ or ° 它会给我解析错误。 最佳答案 是的,这些实体是在 HTML 中定义的,但通常不是在 XML 中(当然,除非它们都在 DTD 中定义)=
如何在 jQuery slider 中将值保留到小数点后 1 位?例如。 25-> 25.0 如何在.val()中显示°C或°F,它只显示“°”而不是符号? 谢谢!!! 这是我的代码: fu
当我以较小的 Angular 值(如 1 度)检查旋转功能时,它是否会不准确? 因为我注意到了这一点,我的计算结果是正确的,但物体有可能或多或少地倾斜了一点。 我用 js-control-css 旋转
这是我的代码: #move{ height:70px; width:70px; border:2px solid black; border-radius:15px; }
这个问题在这里已经有了答案: How do I decode HTML entities in Swift? (23 个回答) 关闭 6 年前。 当我从中读取数据时,比如说 http://www.w
我是一名优秀的程序员,十分优秀!