le mie informazioni di contatto
Posta[email protected]
2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
La trasformazione può essere semplicemente intesa come deformazione
Mobile: traduci
Ruota: ruota
Zoom: scala
- /* 移动盒子的位置: 定位 盒子的外边距 2d转换移动 */
-
-
-
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- /* x就是x轴上移动位置 y 就是y轴上移动位置 中间用逗号分隔*/
-
- /* transform: translate(x, y); */
-
- /* transform: translate(100px, 100px); */
-
- /* 1. 我们如果只移动x坐标 */
-
- /* transform: translate(100px, 0); */
-
- /* transform: translateX(100px); */
-
- /* 2. 我们如果只移动y坐标 */
-
- /* transform: translate(0, 100px); */
-
- /* transform: translateY(100px); */
-
- }
-
-
-
- div:first-child {
-
- transform: translate(30px, 30px);
-
- }
-
-
-
- div:last-child {
-
- background-color: purple;
-
- }
- div {
-
- position: relative;
-
- width: 500px;
-
- height: 500px;
-
- background-color: pink;
-
- /* 1. 我们tranlate里面的参数是可以用 % */
-
- /* 2. 如果里面的参数是 % 移动的距离是 盒子自身的宽度或者高度来对比的 */
-
- /* 这里的 50% 就是 50px 因为盒子的宽度是 100px */
-
- /* transform: translateX(50%); */
-
- }
-
- p {
-
- position: absolute;
-
- top: 50%;
-
- left: 50%;
-
- width: 200px;
-
- height: 200px;
-
- background-color: purple;
-
- /* margin-top: -100px;
-
- margin-left: -100px; */;
-
- /* 盒子往上走自己高度的一半 */
-
- transform: translate(-50%, -50%);
-
- }
- img {
-
- width: 150px;
-
- /* 顺时针旋转45度 */
-
- /* transform: rotate(45deg); */
-
- border-radius: 50%;
-
- border: 5px solid pink;
-
- /* 过渡写到本身上,谁做动画给谁加 */
-
- transition: all 0.3s;
-
- }
-
-
-
- img:hover {
-
- transform: rotate(90deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <img src="media/pic.jpg" alt="">
-
- </body>
- div {
-
- position: relative;
-
- width: 249px;
-
- height: 35px;
-
- border: 1px solid #000;
-
- }
-
- div::after {
-
- content: "";
-
- position: absolute;
-
- top: 8px;
-
- right: 15px;
-
- width: 10px;
-
- height: 10px;
-
- border-right: 1px solid #000;
-
- border-bottom: 1px solid #000;
-
- transform: rotate(45deg);
-
- transition: all 0.2s;
-
- }
-
- /* 鼠标经过div 里面的三角旋转 */
-
-
-
- div:hover::after {
-
- transform: rotate(225deg);
-
- }
1. Grammatica
origine-trasformazione:xy;
2. Punti chiave
·Notare che i seguenti parametri xey sono separati da spazi
·Il punto centrale della conversione predefinita xy è il punto centrale dell'elemento (50%50%)
·Puoi anche impostare pixel o nomi di orientamento per xy (in alto in basso a sinistra a destra al centro)
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- margin: 100px auto;
-
- transition: all 1s;
-
- /* 1.可以跟方位名词 */
-
- /* transform-origin: left bottom; */
-
- /* 2. 默认的是 50% 50% 等价于 center center */
-
- /* 3. 可以是px 像素 */
-
- /* transform-origin: 80px 80px; */
-
- /* transform-origin: top left; */
-
- transform-origin: bottom right ;
-
- }
-
-
-
- div:hover {
-
- transform: rotate(360deg);
-
- }
- div {
-
- overflow: hidden;
-
- width: 200px;
-
- height: 200px;
-
- border: 1px solid pink;
-
- margin: 10px;
-
- float: left;
-
- }
-
- div::before {
-
- content: "小猪佩奇";
-
- display: block;
-
- width: 100%;
-
- height: 100%;
-
- background-image: url("./media/pig.jpg");
-
- transform: rotate(180deg);
-
- transform-origin: left bottom;
-
- transition: all 0.4s;
-
- }
-
- /* 鼠标经过div 里面的before 复原 */
-
-
-
- div:hover::before {
-
- transform: rotate(0deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div></div>
-
- <div></div>
-
- <div></div>
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- margin: 100px auto;
-
- /* transform-origin: left bottom; */
-
- }
-
-
-
- div:hover {
-
- /* 1. 里面写的数字不跟单位 就是倍数的意思 1 就是1倍 2就是 2倍 */
-
- /* transform: scale(x, y); */
-
- /* transform: scale(2, 2); */
-
- /* 2. 修改了宽度为原来的2倍 高度 不变 */
-
- /* transform: scale(2, 1); */
-
- /* 3. 等比例缩放 同时修改宽度和高度,我们有简单的写法 以下是 宽度修改了2倍,高度默认和第一个参数一样*/
-
- /* transform: scale(2); */
-
- /* 4. 我们可以进行缩小 小于1 就是缩放 */
-
- /* transform: scale(0.5, 0.5); */
-
- /* transform: scale(0.5); */
-
- /* 5. scale 的优势之处: 不会影响其他的盒子 而且可以设置缩放的中心点*/
-
- /* width: 300px;
-
- height: 300px; */
-
- transform: scale(2);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div></div>
-
- 123123
- li {
-
- float: left;
-
- width: 30px;
-
- height: 30px;
-
- border: 1px solid pink;
-
- margin: 10px;
-
- text-align: center;
-
- line-height: 30px;
-
- list-style: none;
-
- border-radius: 50%;
-
- /* 小手 */
-
- cursor: pointer;
-
- transition: all .4s;
-
- }
-
-
-
- li:hover {
-
- transform: scale(1.2);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <ul>
-
- <li>1</li>
-
- <li>2</li>
-
- <li>3</li>
-
- <li>4</li>
-
- <li>5</li>
-
- <li>6</li>
-
- <li>7</li>
-
- </ul>
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- transition: all .5s;
-
- }
-
-
-
- div:hover {
-
- /* transform: rotate(180deg) translate(150px, 50px); */
-
- /* 我们同时有位移和其他属性,我们需要把位移放到最前面 */
-
- transform: translate(150px, 50px) rotate(180deg) scale(1.2);
-
- }
La realizzazione dell'animazione è divisa in due fasi:
1. Definire prima l'animazione
2. Riutilizzare l'animazione (chiamata).
1. Utilizza i fotogrammi chiave per definire le animazioni (simile alla definizione dei selettori di classe)
@nome animazione fotogrammi chiave{
0%{
larghezza: 100px;
}
100%{
larghezza: 200px;
}
}
2. Usa l'animazione per gli elementi
dividi
larghezza:200px; altezza:200px; colore di sfondo: acquamarina; margine:100px auto;
/*Animazione della chiamata*/
nome-animazione: nome dell'animazione;
/*durata*/
durata-animazione: durata }
- /* 我们想页面一打开,一个盒子就从左边走到右边 */
-
- /* 1. 定义动画 */
-
-
-
- @keyframes move {
-
- /* 开始状态 */
-
- 0% {transform: translateX(0px);}
-
- /* 结束状态 */
-
- 100% {transform: translateX(1000px);}
-
- }
-
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- /* 2. 调用动画 */
-
- /* 动画名称 */
-
- animation-name: move;
-
- /* 持续时间 */
-
- animation-duration: 2s;
-
- }
- /* from to 等价于 0% 和 100% */
-
- /* @keyframes move {
-
- from {
-
- transform: translate(0, 0);
-
- }
-
- to {
-
- transform: translate(1000px, 0);
-
- }
-
- } */
-
- /* 动画序列 */
-
- /* 1. 可以做多个状态的变化 keyframe 关键帧 */
-
- /* 2. 里面的百分比要是整数 */
-
- /* 3. 里面的百分比就是 总的时间(我们这个案例10s)的划分 25% * 10 = 2.5s */
-
-
-
- @keyframes move {
-
- 0% {
-
- transform: translate(0, 0);
-
- }
-
- 25% {
-
- transform: translate(1000px, 0)
-
- }
-
- 50% {
-
- transform: translate(1000px, 500px);
-
- }
-
- 75% {
-
- transform: translate(0, 500px);
-
- }
-
- 100% {
-
- transform: translate(0, 0);
-
- }
-
- }
-
-
-
- div {
-
- width: 100px;
-
- height: 100px;
-
- background-color: pink;
-
- animation-name: move;
-
- animation-duration: 10s;
-
- }
Attributi | descrivere |
@fotogrammi chiave | Specifica l'animazione |
animazione | Proprietà abbreviata per tutte le proprietà di animazione |
nome-animazione | Specifica il nome dell'animazione @keyframes (obbligatorio) |
durata-animazione | Specifica i secondi o i millisecondi necessari all'animazione per completare un ciclo. Il valore predefinito è 0. (necessario) |
funzione-temporizzazione-animazione | Specifica la curva di velocità dell'animazione, il valore predefinito è 'facilità' |
ritardo animazione | Specifica quando inizia l'animazione, il valore predefinito è 0 |
conteggio-iterazione-animazione | Specifica il numero di volte in cui viene riprodotta l'animazione, il valore predefinito è 1 e infinito |
direzione dell'animazione | Specifica se l'animazione verrà riprodotta all'indietro nel ciclo successivo. L'impostazione predefinita è 'normale', l'alternativa viene riprodotta all'indietro. |
animazione-riproduzione-stato | Specifica se l'animazione è in esecuzione o in pausa, l'impostazione predefinita è "in esecuzione" e "pausa" |
modalità-riempimento-animazione | Specifica lo stato al termine dell'animazione, continua in avanti e torna all'inizio all'indietro |
- @keyframes move {
-
- 0% {
-
- transform: translate(0, 0);
-
- }
-
- 100% {
-
- transform: translate(1000px, 0);
-
- }
-
- }
-
-
-
- div {
-
- width: 100px;
-
- height: 100px;
-
- background-color: pink;
-
- /* 动画名称 */
-
- animation-name: move;
-
- /* 持续时间 */
-
- animation-duration: 2s;
-
- /* 运动曲线 */
-
- /* animation-timing-function: ease; */
-
- /* 何时开始 */
-
- animation-delay: 2s;
-
- /* 重复次数 iteration 重复的 conut 次数 infinite 无限 */
-
- /* animation-iteration-count: infinite; */
-
- /* 是否反方向播放 默认的是 normal 如果想要反方向 就写 alternate */
-
- /* animation-direction: alternate; */
-
- /* 动画结束后的状态 默认的是 backwards 回到起始状态 我们可以让他停留在结束状态 forwards */
-
- /* animation-fill-mode: forwards; */
-
- /* animation: name duration timing-function delay iteration-count direction fill-mode; */
-
- /* animation: move 2s linear 0s 1 alternate forwards; */
-
- /* 前面2个属性 name duration 一定要写 */
-
- /* animation: move 2s linear alternate forwards; */
-
- }
-
-
-
- div:hover {
-
- /* 鼠标经过div 让这个div 停止动画,鼠标离开就继续动画 */
-
- animation-play-state: paused;
-
- }
- body {
-
- background-color: #333;
-
- }
-
-
-
- .map {
-
- position: relative;
-
- width: 747px;
-
- height: 616px;
-
- background: url(media/map.png) no-repeat;
-
- margin: 0 auto;
-
- }
-
-
-
- .city {
-
- position: absolute;
-
- top: 227px;
-
- right: 193px;
-
- color: #fff;
-
- }
-
-
-
- .tb {
-
- top: 500px;
-
- right: 80px;
-
- }
-
-
-
- .dotted {
-
- width: 8px;
-
- height: 8px;
-
- background-color: #09f;
-
- border-radius: 50%;
-
- }
-
-
-
- .city div[class^="pulse"] {
-
- /* 保证我们小波纹在父盒子里面水平垂直居中 放大之后就会中心向四周发散 */
-
- position: absolute;
-
- top: 50%;
-
- left: 50%;
-
- transform: translate(-50%, -50%);
-
- width: 8px;
-
- height: 8px;
-
- box-shadow: 0 0 12px #009dfd;
-
- border-radius: 50%;
-
- animation: pulse 1.2s linear infinite;
-
- }
-
- .city div.pulse2 {
-
- animation-delay: 0.4s;
-
- }
-
-
-
- .city div.pulse3 {
-
- animation-delay: 0.8s;
-
- }
-
-
-
- @keyframes pulse {
-
- 0% {}
-
- 70% {
-
- /* transform: scale(5); 我们不要用scale 因为他会让 阴影变大*/
-
- width: 40px;
-
- height: 40px;
-
- opacity: 1;
-
- }
-
- 100% {
-
- width: 70px;
-
- height: 70px;
-
- opacity: 0;
-
- }
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div class="map">
-
- <div class="city">
-
- <div class="dotted"></div>
-
- <div class="pulse1"></div>
-
- <div class="pulse2"></div>
-
- <div class="pulse3"></div>
-
- </div>
-
- <div class="city tb">
-
- <div class="dotted"></div>
-
- <div class="pulse1"></div>
-
- <div class="pulse2"></div>
-
- <div class="pulse3"></div>
-
- </div>
-
- </div>
- div {
-
- overflow: hidden;
-
- font-size: 20px;
-
- width: 0;
-
- height: 30px;
-
- background-color: pink;
-
- /* 让我们的文字强制一行内显示 */
-
- white-space: nowrap;
-
- /* steps 就是分几步来完成我们的动画 有了steps 就不要在写 ease 或者linear 了 */
-
- animation: w 4s steps(10) forwards;
-
- }
-
-
-
- @keyframes w {
-
- 0% {
-
- width: 0;
-
- }
-
- 100% {
-
- width: 200px;
-
- }
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div>世纪佳缘我在这里等你</div>
- body {
-
- background-color: #ccc;
-
- }
-
-
-
- div {
-
- position: absolute;
-
- width: 200px;
-
- height: 100px;
-
- background: url(media/bear.png) no-repeat;
-
- /* 我们元素可以添加多个动画, 用逗号分隔 */
-
- animation: bear .6s steps(8) infinite, move 4s forwards;
-
- }
-
-
-
- @keyframes bear {
-
- 0% {
-
- background-position: 0 0;
-
- }
-
- 100% {
-
- background-position: -1600px 0;
-
- }
-
- }
-
-
-
- @keyframes move {
-
- 0% {
-
- left: 0;
-
- }
-
- 100% {
-
- left: 50%;
-
- /* margin-left: -100px; */
-
- transform: translateX(-50%);
-
- }
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div></div>
Il sistema di coordinate tridimensionale si riferisce in realtà allo spazio tridimensionale, che è composto da tre assi.
·asse x: orizzontalmente a destra Nota: il lato destro di X ha un valore positivo e il lato sinistro ha un valore negativo
·asse y: verticalmente verso il basso Nota: la parte inferiore di y è un valore positivo e la parte superiore è un valore negativo.
·Asse Z: schermo verticale Nota: valori positivi verso l'esterno e valori negativi verso l'interno
Translate:translateX(100px): spostati semplicemente sull'asse x
Translate:translateY (100px): basta spostarsi sull'asse Y
translform:translateZ (100px): basta spostarsi sull'asse z (nota: translateZ è generalmente in unità px) transform:translate3d (x, y,): dove x, y e z si riferiscono rispettivamente alla distanza nella direzione di l'asse da spostare.
- body {
-
- /* 透视写到被观察元素的父盒子上面 */
-
- perspective: 200px;
-
- }
-
-
-
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- /* transform: translateX(100px);
-
- transform: translateY(100px); */
-
- /* transform: translateX(100px) translateY(100px) translateZ(100px); */
-
- /* 1. translateZ 沿着Z轴移动 */
-
- /* 2. translateZ 后面的单位我们一般跟px */
-
- /* 3. translateZ(100px) 向外移动100px (向我们的眼睛来移动的) */
-
- /* 4. 3D移动有简写的方法 */
-
- /* transform: translate3d(x,y,z); */
-
- /* transform: translate3d(100px, 100px, 100px); */
-
- /* 5. xyz是不能省略的,如果没有就写0 */
-
- transform: translate3d(200px, 100px, 100px);
-
- }
- body {
-
- perspective: 600px;
-
- /* 透视写到被观擦元素的父盒子上面 */
-
- }
-
-
-
- div {
-
- width: 200px;
-
- height: 200px;
-
- background-color: pink;
-
- margin: 100px auto;
-
- transform: translateZ(0);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div></div>
-
- <div></div>
-
- <div></div>
-
- </body>
- body {
-
- perspective: 300px;
-
- }
-
-
-
- img {
-
- display: block;
-
- margin: 100px auto;
-
- transition: all 1s;
-
- }
-
-
-
- img:hover {
-
- transform: rotateX(45deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <img src="media/pig.jpg" alt="">
-
-
- body {
-
- perspective: 500px;
-
- }
-
-
-
- img {
-
- display: block;
-
- margin: 100px auto;
-
- transition: all 1s;
-
- }
-
-
-
- img:hover {
-
- /* transform: rotateZ(180deg); */
-
- /* transform: rotate3d(x,y,z,deg); */
-
- /* transform: rotate3d(1, 0, 0, 45deg); */
-
- /* transform: rotate3d(0, 1, 0, 45deg); */
-
- transform: rotate3d(1, 1, 0, 45deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <img src="media/pig.jpg" alt="">
·Controlla se l'elemento figlio attiva l'ambiente tridimensionale. .
·Stile di trasformazione: il sottoelemento piatto non abilita lo spazio 3D per impostazione predefinita
·Stile trasformazione:preserve-3d; il sottoelemento apre lo spazio tridimensionale
·Il codice viene scritto nel genitore, ma influisce sulla casella figlio
- body {
-
- perspective: 500px;
-
- }
-
-
-
- .box {
-
- position: relative;
-
- width: 200px;
-
- height: 200px;
-
- margin: 100px auto;
-
- transition: all 2s;
-
- /* 让子元素保持3d立体空间环境 */
-
- transform-style: preserve-3d;
-
- }
-
-
-
- .box:hover {
-
- transform: rotateY(60deg);
-
- }
-
-
-
- .box div {
-
- position: absolute;
-
- top: 0;
-
- left: 0;
-
- width: 100%;
-
- height: 100%;
-
- background-color: pink;
-
- }
-
-
-
- .box div:last-child {
-
- background-color: purple;
-
- transform: rotateX(60deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div class="box">
-
- <div></div>
-
- <div></div>
-
- </div>
1. Costruisci la struttura HTML
<div class="box">
<div class="front">Programmatore cavallo oscuro</div>
<div class="back">La maestra Pink ti sta aspettando</div>
</div>
·La casella madre contiene due caselle figlie prima e dopo
·La scatola è una scatola capovolta, quella anteriore è quella anteriore e quella posteriore è quella posteriore.
- body {
-
- perspective: 400px;
-
- }
-
- .box {
-
- position: relative;
-
- width: 300px;
-
- height: 300px;
-
- margin: 100px auto;
-
- transition: all .4s;
-
- /* 让背面的紫色盒子保留立体空间 给父级添加的 */
-
- transform-style: preserve-3d;
-
- }
-
-
-
- .box:hover {
-
- transform: rotateY(180deg);
-
- }
-
-
-
- .front,
-
- .back {
-
- position: absolute;
-
- top: 0;
-
- left: 0;
-
- width: 100%;
-
- height: 100%;
-
- border-radius: 50%;
-
- font-size: 30px;
-
- color: #fff;
-
- text-align: center;
-
- line-height: 300px;
-
- }
-
- .front {
-
- background-color: pink;
-
- z-index: 1;
-
- }
-
-
-
- .back {
-
- background-color: purple;
-
- /* 像手机一样 背靠背 旋转 */
-
- transform: rotateY(180deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="back">pink老师这里等你</div>
-
- </div>
- * {
-
- margin: 0;
-
- padding: 0;
-
- }
-
-
-
- ul {
-
- margin: 100px;
-
- }
-
-
-
- ul li {
-
- float: left;
-
- margin: 0 5px;
-
- width: 120px;
-
- height: 35px;
-
- list-style: none;
-
- /* 一会我们需要给box 旋转 也需要透视 干脆给li加 里面的子盒子都有透视效果 */
-
- perspective: 500px;
-
- }
-
-
-
- .box {
-
- position: relative;
-
- width: 100%;
-
- height: 100%;
-
- transform-style: preserve-3d;
-
- transition: all .4s;
-
- }
-
-
-
- .box:hover {
-
- transform: rotateX(90deg);
-
- }
-
-
-
- .front,
-
- .bottom {
-
- position: absolute;
-
- left: 0;
-
- top: 0;
-
- width: 100%;
-
- height: 100%;
-
- }
-
-
-
- .front {
-
- background-color: pink;
-
- z-index: 1;
-
- transform: translateZ(17.5px);
-
- }
-
-
-
- .bottom {
-
- background-color: purple;
-
- /* 这个x轴一定是负值 */
-
- /* 我们如果有移动 或者其他样式,必须先写我们的移动 */
-
- transform: translateY(17.5px) rotateX(-90deg);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <ul>
-
- <li>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="bottom">pink老师等你</div>
-
- </div>
-
- </li>
-
- <li>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="bottom">pink老师等你</div>
-
- </div>
-
- </li>
-
- <li>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="bottom">pink老师等你</div>
-
- </div>
-
- </li>
-
- <li>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="bottom">pink老师等你</div>
-
- </div>
-
- </li>
-
- <li>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="bottom">pink老师等你</div>
-
- </div>
-
- </li>
-
- <li>
-
- <div class="box">
-
- <div class="front">黑马程序员</div>
-
- <div class="bottom">pink老师等你</div>
-
- </div>
-
- </li>
-
- </ul>
- body {
-
- perspective: 1000px;
-
- }
-
-
-
- section {
-
- position: relative;
-
- width: 300px;
-
- height: 200px;
-
- margin: 150px auto;
-
- transform-style: preserve-3d;
-
- /* 添加动画效果 */
-
- animation: rotate 10s linear infinite;
-
- background: url(media/pig.jpg) no-repeat;
-
- }
-
-
-
- section:hover {
-
- /* 鼠标放入section 停止动画 */
-
- animation-play-state: paused;
-
- }
-
-
-
- @keyframes rotate {
-
- 0% {
-
- transform: rotateY(0);
-
- }
-
- 100% {
-
- transform: rotateY(360deg);
-
- }
-
- }
-
-
-
- section div {
-
- position: absolute;
-
- top: 0;
-
- left: 0;
-
- width: 100%;
-
- height: 100%;
-
- background: url(media/dog.jpg) no-repeat;
-
- }
-
- /* 正对着的图片 z轴*/
-
- section div:nth-child(1) {
-
- transform: rotateY(0) translateZ(300px);
-
- }
-
- /* 右边的图片 */
-
- section div:nth-child(2) {
-
- /* 先旋转好了再 移动距离 */
-
- transform: rotateY(60deg) translateZ(300px);
-
- }
-
-
-
- section div:nth-child(3) {
-
- /* 先旋转好了再 移动距离 */
-
- transform: rotateY(120deg) translateZ(300px);
-
- }
-
-
-
- section div:nth-child(4) {
-
- /* 先旋转好了再 移动距离 */
-
- transform: rotateY(180deg) translateZ(300px);
-
- }
-
-
-
- section div:nth-child(5) {
-
- /* 先旋转好了再 移动距离 */
-
- transform: rotateY(240deg) translateZ(300px);
-
- }
-
-
-
- section div:nth-child(6) {
-
- /* 先旋转好了再 移动距离 */
-
- transform: rotateY(300deg) translateZ(300px);
-
- }
-
- </style>
-
- </head>
-
-
- <body>
-
- <section>
-
- <div></div>
-
- <div></div>
-
- <div></div>
-
- <div></div>
-
- <div></div>
-
- <div></div>
-
- </section>
-moz-: rappresenta le proprietà private del browser Firefox
-ms-: rappresenta gli attributi privati del browser IE
-webkit-: rappresenta le proprietà private di Safari e Chrome
-o-: rappresenta le proprietà private dell'Opera
2. Il metodo di scrittura consigliato
-moz-border-radius:10px;
-webkit-border-radius:10px;
-o-border-radius:10px;border-radius:10px;