Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 午夜激情免费视频,国产资源在线播放,一区二区在线看

          整合營銷服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢熱線:

          CSS函數(shù)translate、translate3d的使用

          ranslate()translate3d()函數(shù)可以實(shí)現(xiàn)元素在指定軸的平移的功能。函數(shù)使用在CSS轉(zhuǎn)換屬性transform的屬性值。實(shí)現(xiàn)轉(zhuǎn)換的函數(shù)類型有:

          • translate():2D平面實(shí)現(xiàn)X軸、Y軸的平移
          • translate3d():3D空間實(shí)現(xiàn)位置的平移
          • translateX():實(shí)現(xiàn)X軸方向的元素移動(dòng)
          • translateY():實(shí)現(xiàn)Y軸方向的元素移動(dòng)

          translate()

          translate()函數(shù)用于移動(dòng)元素在2D平面的位置,其語法格式如下:

          translate(tx)       或
          translate(tx, ty)
          • tx:需要移動(dòng)的x軸距離
          • ty:需要移動(dòng)的y軸距離

          示例代碼如下:

          <style>
          .container .translate>div>div {
              display: inline-block;
              padding: 30px;
              background-color: aqua;
          }
          .container .translate>div>.result {
              transform: translate(-10px,10px);
              background-color: red;
          }
          
          </style>
          
          <div class="translate">
             <h3>translate函數(shù)使用</h3>
             <div>
                 <div class="original ">original container</div>
                 <div class="result">translate函數(shù)使用(100,200) container</div>
             </div>
          </div>

          展示結(jié)果:

          CSS3中,可以利用transform功能來實(shí)現(xiàn)文字或圖像的旋轉(zhuǎn)、縮放、傾斜、移動(dòng)這四種類型的變形處理,本文將對(duì)此做詳細(xì)介紹。

          一.旋轉(zhuǎn) rotate

          用法:transform: rotate(45deg);

          共一個(gè)參數(shù)“角度”,單位deg為度的意思,正數(shù)為順時(shí)針旋轉(zhuǎn),負(fù)數(shù)為逆時(shí)針旋轉(zhuǎn),上述代碼作用是順時(shí)針旋轉(zhuǎn)45度。

          二.縮放 scale

          用法:transform: scale(0.5) 或者 transform: scale(0.5, 2);

          參數(shù)表示縮放倍數(shù);

          • 一個(gè)參數(shù)時(shí):表示水平和垂直同時(shí)縮放該倍率
          • 兩個(gè)參數(shù)時(shí):第一個(gè)參數(shù)指定水平方向的縮放倍率,第二個(gè)參數(shù)指定垂直方向的縮放倍率。

          三.傾斜 skew

          用法:transform: skew(30deg) 或者 transform: skew(30deg, 30deg);

          參數(shù)表示傾斜角度,單位deg

          • 一個(gè)參數(shù)時(shí):表示水平方向的傾斜角度;
          • 兩個(gè)參數(shù)時(shí):第一個(gè)參數(shù)表示水平方向的傾斜角度,第二個(gè)參數(shù)表示垂直方向的傾斜角度。

          關(guān)于skew傾斜角度的計(jì)算方式表面上看并不是那么直觀,這里借鑒某大拿繪制的圖舉例說明一下:

          首先需要說明的是skew的默認(rèn)原點(diǎn)transform-origin是這個(gè)物件的中心點(diǎn)

          四.移動(dòng) translate

          用法:transform: translate(45px) 或者 transform: translate(45px, 150px);

          參數(shù)表示移動(dòng)距離,單位px,

          • 一個(gè)參數(shù)時(shí):表示水平方向的移動(dòng)距離;
          • 兩個(gè)參數(shù)時(shí):第一個(gè)參數(shù)表示水平方向的移動(dòng)距離,第二個(gè)參數(shù)表示垂直方向的移動(dòng)距離。

          五.基準(zhǔn)點(diǎn) transform-origin

          在使用transform方法進(jìn)行文字或圖像的變形時(shí),是以元素的中心點(diǎn)為基準(zhǔn)點(diǎn)進(jìn)行的。使用transform-origin屬性,可以改變變形的基準(zhǔn)點(diǎn)。

          用法:transform-origin: 10px 10px;

          共兩個(gè)參數(shù),表示相對(duì)左上角原點(diǎn)的距離,單位px,第一個(gè)參數(shù)表示相對(duì)左上角原點(diǎn)水平方向的距離,第二個(gè)參數(shù)表示相對(duì)左上角原點(diǎn)垂直方向的距離;

          兩個(gè)參數(shù)除了可以設(shè)置為具體的像素值,其中第一個(gè)參數(shù)可以指定為left、center、right,第二個(gè)參數(shù)可以指定為top、center、bottom。

          六.多方法組合變形

          上面我們介紹了使用transform對(duì)元素進(jìn)行旋轉(zhuǎn)、縮放、傾斜、移動(dòng)的方法,這里講介紹綜合使用這幾個(gè)方法來對(duì)一個(gè)元素進(jìn)行多重變形。

          用法:transform: rotate(45deg) scale(0.5) skew(30deg, 30deg) translate(100px, 100px);

          這四種變形方法順序可以隨意,但不同的順序?qū)е伦冃谓Y(jié)果不同,原因是變形的順序是從左到右依次進(jìn)行,這個(gè)用法中的執(zhí)行順序?yàn)?.rotate 2.scalse 3.skew 4.translate

          以上內(nèi)容來源于網(wǎng)路 侵刪~

          言:

          圣誕節(jié)快到了,是不是要給女朋友或者正在追求的妹子一點(diǎn)小驚喜呢,今天這篇博客就分享下前端代碼如何實(shí)現(xiàn)3D立體動(dòng)態(tài)相冊(cè)。趕緊學(xué)會(huì)了,來制作屬于我們程序員的浪漫吧!先上效果圖,來引起下你們的興趣。

          正文:

          一、新建一個(gè)index.html的文件,代碼如下

          <!DOCTYPE html>
          <html lang="en">
          <head>
          <meta charset="UTF-8">
          <title>純CSS實(shí)現(xiàn)鼠標(biāo)經(jīng)過3D立體動(dòng)態(tài)展示圖片特效代碼</title>
          <link type="text/css" href="css/style.css" rel="stylesheet" />
          </head>
          <body>
          <div class="box">
          	<ul class="minbox">
          		<li></li>
          		<li></li>
          		<li></li>
          		<li></li>
          		<li></li>
          		<li></li>
          	</ul>
          	<ol class="maxbox">
          		<li></li>
          		<li></li>
          		<li></li>
          		<li></li>
          		<li></li>
          		<li></li>
          	</ol>
          </div>
          </body>
          </html>

          二、css樣式的代碼

          @charset "utf-8";
          *{
          	margin:0;
          	padding:0;
          }
          body{
          	max-width: 100%;
          	min-width: 100%;
          	height: 100%;
          	background-size: cover;
          	background-repeat: no-repeat;
          	background-attachment: fixed;
          	background-size:100% 100%;
          	position: absolute;
          	margin-left: auto;
          	margin-right: auto;
          }
          li{
          	list-style: none;
          }
          .box{
          	width:200px;
          	height:200px;
          	background-size: cover;
          	background-repeat: no-repeat;
          	background-attachment: fixed;
          	background-size:100% 100%;
          	position: absolute;
          	margin-left: 42%;
          	margin-top: 22%;
          	-webkit-transform-style:preserve-3d;
          	-webkit-transform:rotateX(13deg);
          	-webkit-animation:move 5s linear infinite;
          }
          .minbox{
          	width:100px;
          	height:100px;
          	position: absolute;
          	left:50px;
          	top:30px;
          	-webkit-transform-style:preserve-3d;
          }
          .minbox li{
          	width:100px;
          	height:100px;
          	position: absolute;
          	left:0;
          	top:0;
          }
          .minbox li:nth-child(1){
          	background: url(../img/01.png) no-repeat 0 0;
          	-webkit-transform:translateZ(50px);
          }
          .minbox li:nth-child(2){
          	background: url(../img/02.png) no-repeat 0 0;
          	-webkit-transform:rotateX(180deg) translateZ(50px);
          }
          .minbox li:nth-child(3){
          	background: url(../img/03.png) no-repeat 0 0;
          	-webkit-transform:rotateX(-90deg) translateZ(50px);
          }
          .minbox li:nth-child(4){
          	background: url(../img/04.png) no-repeat 0 0;
          	-webkit-transform:rotateX(90deg) translateZ(50px);
          }
          .minbox li:nth-child(5){
          	background: url(../img/05.png) no-repeat 0 0;
          	-webkit-transform:rotateY(-90deg) translateZ(50px);
          }
          .minbox li:nth-child(6){
          	background: url(../img/06.png) no-repeat 0 0;
          	-webkit-transform:rotateY(90deg) translateZ(50px);
          }
          .maxbox li:nth-child(1){
          	background: url(../img/1.png) no-repeat 0 0;
          	-webkit-transform:translateZ(50px);
          }
          .maxbox li:nth-child(2){
          	background: url(../img/2.png) no-repeat 0 0;
          	-webkit-transform:translateZ(50px);
          }
          .maxbox li:nth-child(3){
          	background: url(../img/3.png) no-repeat 0 0;
          	-webkit-transform:rotateX(-90deg) translateZ(50px);
          }
          .maxbox li:nth-child(4){
          	background: url(../img/4.png) no-repeat 0 0;
          	-webkit-transform:rotateX(90deg) translateZ(50px);
          }
          .maxbox li:nth-child(5){
          	background: url(../img/5.png) no-repeat 0 0;
          	-webkit-transform:rotateY(-90deg) translateZ(50px);
          }
          .maxbox li:nth-child(6){
          	background: url(../img/6.png) no-repeat 0 0;
          	-webkit-transform:rotateY(90deg) translateZ(50px);
          }
          .maxbox{
          	width: 800px;
          	height: 400px;
          	position: absolute;
          	left: 0;
          	top: -20px;
          	-webkit-transform-style: preserve-3d;
          	
          }
          .maxbox li{
          	width: 200px;
          	height: 200px;
          	background: #fff;
          	border:1px solid #ccc;
          	position: absolute;
          	left: 0;
          	top: 0;
          	opacity: 0.2;
          	-webkit-transition:all 1s ease;
          }
          .maxbox li:nth-child(1){
          	-webkit-transform:translateZ(100px);
          }
          .maxbox li:nth-child(2){
          	-webkit-transform:rotateX(180deg) translateZ(100px);
          }
          .maxbox li:nth-child(3){
          	-webkit-transform:rotateX(-90deg) translateZ(100px);
          }
          .maxbox li:nth-child(4){
          	-webkit-transform:rotateX(90deg) translateZ(100px);
          }
          .maxbox li:nth-child(5){
          	-webkit-transform:rotateY(-90deg) translateZ(100px);
          }
          .maxbox li:nth-child(6){
          	-webkit-transform:rotateY(90deg) translateZ(100px);
          }
          .box:hover ol li:nth-child(1){
          	-webkit-transform:translateZ(300px);
          	width: 400px;
          	height: 400px;
          	opacity: 0.8;
          	left: -100px;
          	top: -100px;
          }
          .box:hover ol li:nth-child(2){
          	-webkit-transform:rotateX(180deg) translateZ(300px);
          	width: 400px;
          	height: 400px;
          	opacity: 0.8;
          	left: -100px;
          	top: -100px;
          }
          .box:hover ol li:nth-child(3){
          	-webkit-transform:rotateX(-90deg) translateZ(300px);
          	width: 400px;
          	height: 400px;
          	opacity: 0.8;
          	left: -100px;
          	top: -100px;
          }
          .box:hover ol li:nth-child(4){
          	-webkit-transform:rotateX(90deg) translateZ(300px);
          	width: 400px;
          	height: 400px;
          	opacity: 0.8;
          	left: -100px;
          	top: -100px;
          }
          .box:hover ol li:nth-child(5){
          	-webkit-transform:rotateY(-90deg) translateZ(300px);
          	width: 400px;
          	height: 400px;
          	opacity: 0.8;
          	left: -100px;
          	top: -100px;
          }
          .box:hover ol li:nth-child(6){
          	-webkit-transform:rotateY(90deg) translateZ(300px);
          	width: 400px;
          	height: 400px;
          	opacity: 0.8;
          	left: -100px;
          	top: -100px;
          }
          @keyframes move{
          	0%{
          		-webkit-transform: rotateX(13deg) rotateY(0deg);
          	}
          	100%{
          		-webkit-transform:rotateX(13deg) rotateY(360deg);
          	}
          }

          三、文件的目錄結(jié)構(gòu),把css文件放到css文件夾里,圖片放到img文件夾里。

          四、圖片尺寸不會(huì)修改的,可以選擇使用美圖秀秀網(wǎng)頁版很簡單

          五、容易出現(xiàn)的問題 ,圖片展示不全或展示的方向不對(duì)

          1.圖片尺寸需要修改 (解決展示不全的情況)

          上圖是我的圖片文件夾里放的圖片 ,首先01-06編號(hào)命名的圖片尺寸是100x100px的大小的,1-6編號(hào)是400x400px,如果效果想展示最佳,100x100px的圖片是以頭部特寫的照片最好,因?yàn)?1-06是立體照片內(nèi)部小正方體的照片,1-6編號(hào)是外部正方體的照片。

          2.圖片的方向需要修改(解決頭朝下的問題)

          修改的方向如上圖展示所示,比如第三張頭就應(yīng)該朝下,否則形成的效果圖像會(huì)出現(xiàn)頭是倒著的情況。

          六、放一下動(dòng)態(tài)效果圖

          總結(jié):

          生活雖然總有辛酸,但是我們不應(yīng)該減少去創(chuàng)造生活的樂趣,不斷尋找屬于自己的那份快樂,才應(yīng)該是我們生活的態(tài)度。

          我自己是一名從事了多年開發(fā)的web前端老程序員,目前辭職在做自己的web前端私人定制課程,今年年初我花了一個(gè)月整理了一份最適合2019年學(xué)習(xí)的web前端學(xué)習(xí)干貨,各種框架都有整理,送給每一位前端小伙伴,想要獲取的可以關(guān)注我的頭條號(hào)并在后臺(tái)私信我:前端,即可免費(fèi)獲取。

          原文鏈接:https://blog.csdn.net/jdk_wangtaida/article/details/103253883


          主站蜘蛛池模板: 色狠狠色噜噜Av天堂一区| 一区五十路在线中出| 视频一区二区三区免费观看| 亚洲一区二区三区久久久久| 亚洲视频在线一区二区三区| 国产91大片精品一区在线观看 | 精品无码综合一区二区三区| 无码av人妻一区二区三区四区 | 日韩精品一区在线| 无码av不卡一区二区三区| 中文字幕精品无码一区二区三区| 久久中文字幕一区二区| AA区一区二区三无码精片| 精品国产一区二区麻豆| www一区二区三区| 精品乱子伦一区二区三区| 久久国产免费一区二区三区| 国产一区在线mmai| 国模精品一区二区三区视频| 福利电影一区二区| 国偷自产av一区二区三区| 亚洲中文字幕一区精品自拍| 色噜噜一区二区三区| 综合久久一区二区三区 | 精品视频一区二区三区四区五区| a级午夜毛片免费一区二区| 麻豆一区二区三区精品视频| 色综合久久一区二区三区| 亚洲中文字幕丝袜制服一区| 蜜臀Av午夜一区二区三区| 国产成人久久一区二区三区| 国模吧一区二区三区| 亚洲欧美日韩国产精品一区| 亚洲成a人一区二区三区| 亚洲日韩激情无码一区| 成人无号精品一区二区三区| 红杏亚洲影院一区二区三区 | 日韩a无吗一区二区三区| 中文字幕精品一区二区三区视频| 极品尤物一区二区三区| 国产一区二区三区在线影院|