css里 Y轴的居中用什么 X轴的居中用什么

html-css010

css里 Y轴的居中用什么 X轴的居中用什么,第1张

background:.enter bottom no-repeat前面是url路径

全部的位置代码如下:

background-position: left 代表背景图横向(X轴)靠左,纵向(Y轴)居中。(9点钟位置)

background-position: right 代表背景图横向(X轴)靠右,纵向(Y轴)居中。(3点钟位置)

background-position: top 代表背景图横向(X轴)居中,纵向(Y轴)靠上。(12点钟位置)

background-position: bottom 代表背景图横向(X轴)居中,纵向(Y轴)靠下。(6点钟位置)

background-position: center 代表背景图横向(X轴)居中,纵向(Y轴)居中。(绝对居中)

background-position: left top 代表背景图横向(X轴)靠左,纵向(Y轴)靠上。(10点钟位置)

background-position: left bottom 代表背景图横向(X轴)靠左,纵向(Y轴)靠下。(7点钟位置)

background-position: right top 代表背景图横向(X轴)靠右,纵向(Y轴)靠上。(1点钟位置)

background-position: right bottom 代表背景图横向(X轴)靠右,纵向(Y轴)靠下。(5点钟位置)

transform默认是左上角为起点的,除非是手动设置了

transform-origin 属性允许您改变被转换元素的位置。

2D 转换元素能够改变元素 x 和 y 轴。3D 转换元素还能改变其 Z 轴。 transform-origin: x-axis y-axis z-axis

值描述

x-axis    定义视图被置于 X 轴的何处。可能的值:left | center | right | length | %    

y-axis    定义视图被置于 Y 轴的何处。可能的值:top | center| bottom | length |%    

z-axis    定义视图被置于 Z 轴的何处。可能的值:length