Css高阶用法(一) matrix

html-css09

Css高阶用法(一) matrix,第1张

"点积" 是把 对称的元素相乘,然后把结果加起来:

(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58

我们把第一个元素相配(1 和 7),然后相乘。第二个元素(2 和 9) 和第三个元素(3 和 11)也一样,然后把结果加起来。

总共有6个可动的参数,这六个参数分别控制不同的变换

| a b 0 |

| c d 0 |

| tx ty 1 |

当矩阵为1的单元矩阵的时候,表明该图形没有变换

缩放:scale(sx, sy) 等同于 matrix(sx, 0, 0, sy, 0, 0)

平移:translate(tx, ty) 等同于 matrix(1, 0, 0, 1, tx, ty)

旋转:rotate(deg) 等同于 matrix(cos(deg), sin(deg), -sin(deg), cos(deg), 0, 0)

拉伸:skew(degx, degy) 等同于 matrix(1, tan(degy), tan(degx), 1, 0, 0)

rotate(deg) === matrix(cos(deg), sin(deg), -sin(deg), cos(deg), 0, 0)

由(x,y)旋转到(x',y ')

所以 css中的矩阵表示为:

matrix(cos(deg), sin(deg), -sin(deg), cos(deg), 0, 0)

http://tridiv.com/

让一个物体水平和垂直运动

https://cubic-bezier.com/#.17,.67,.83,.67

https://developer.mozilla.org/zh-CN/docs/Web/CSS/Reference

https://www.shuxuele.com/algebra/matrix-introduction.html

https://www.shuxuele.com/algebra/matrix-multiplying.html

https://www.zhangxinxu.com/wordpress/2012/06/css3-transform-matrix-%E7%9F%A9%E9%98%B5/

https://segmentfault.com/a/1190000009036596

可以给标签家个id或class就可以调整文本框的宽和高。

如:

<style type="text/css">

.text1{width:100pxheight:20px}

</style>

<input type="text" class="text1" />

扩展资料:

在CSS中,使用text-align属性控制文本的水平方向的对齐方式:左对齐、居中对齐、右对齐。

该属性通过指定行框与哪个点对齐,从而设置块级元素内文本的水平对齐方式。通过允许用户代理调整行内容中字母和字之间的间隔,可以支持值 justify;不同用户代理可能会得到不同的结果。

默认值:left if direction is ltr, and right if direction is rtl 

继承:yes 

版本:CSS1 

JavaScript 语法:object.style.textAlign="right" 

参考资料来源:百度百科-text-align

只有块元素才可以默认“继承”其父元素的width.

浮动元素和定位元素也是不默认(不自动)“继承”其父元素宽度的。

当符合css默认“继承”的情况下(子元素必须是块级元素且无定位或浮动),是不需要写width属性,就可以默认“继承”的。