2018-09-10

<!DOCTYPE html>

<html lang="en">

<head>

? ? <meta charset="UTF-8">

? ? <title>Title</title>

? ? <style type="text/css">

? ? ? ? .box1{

? ? ? ? ? ? width: 200px;

? ? ? ? ? ? height: 200px;

? ? ? ? ? ? background-color: #d86aff;

? ? ? ? ? ? /*動(dòng)畫(huà)方向,時(shí)間 運(yùn)動(dòng)曲線ease緩慢變化? 延遲時(shí)間*/

? ? ? ? ? ? transition: width 500ms ease,height 500ms ease 500ms,

? ? ? ? ? ? background-color 500ms ease 1000ms,border-radius 500ms? 1.5s;

? ? ? ? }

? ? ? ? .box1:hover{

? ? ? ? ? ? width: 500px;

? ? ? ? ? ? height: 400px;

? ? ? ? ? ? background-color: #cc0000;

? ? ? ? ? ? border-radius: 50px;

? ? ? ? }

? ? </style>

</head>

<body>

<div class="box1"></div>

</body>

</html>

animation動(dòng)畫(huà)

<!DOCTYPE html>

<html lang="en">

<head>

? ? <meta charset="UTF-8">

? ? <title>Title</title>

? ? <style type="text/css">

? ? ? ? .box1{

? ? ? ? ? ? width: 100px;

? ? ? ? ? ? height: 100px;

? ? ? ? ? ? background-color: #d86aff;

? ? ? ? ? ? animation: moving 500ms ease 1s 6 alternate;/*? 6換成 infinite無(wú)窮次 */

? ? ? ? }

? ? ? ? .box1:hover{

? ? ? ? ? ? animation-play-state: paused;/*暫停*/

? ? ? ? }

? ? ? ? @keyframes moving {

? ? ? ? ? ? from{

? ? ? ? ? ? ? ? width: 100px;

? ? ? ? ? ? }to{

? ? ? ? ? ? ? ? width: 500px;

? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? }

? ? </style>

</head>

<body>

<div class="box1"></div>

</body>

</html>

多幀動(dòng)畫(huà)

<!DOCTYPE html>

<html lang="en">

<head>

? ? <meta charset="UTF-8">

? ? <title>Title</title>

? ? <style type="text/css">

? ? ? ? .box1{

? ? ? ? ? ? width: 100px;

? ? ? ? ? ? height: 100px;

? ? ? ? ? ? background-color: #d86aff;

? ? ? ? ? ? margin: 50px auto 0;

? ? ? ? ? ? animation: moving 1s infinite;

? ? ? ? }

? ? ? ? @keyframes moving {

? ? ? ? ? ? from{

? ? ? ? ? ? ? ? transform: translateY(0);

? ? ? ? ? ? ? ? transform: translateX(0);

? ? ? ? ? ? }25%{

? ? ? ? ? ? transform: translateX(400px);

? ? ? ? ? ? background-color: #cc0000;

? ? ? ? ? ? ? ? ? ? ? ? }50%{

? ? ? ? ? ? transform: translateX(400);

? ? ? ? ? ? background-color: yellow;

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? }

? ? </style>

</head>

<body>

<div class="box1"></div>

</body>

</html>

文字遮罩

<!DOCTYPE html>

<html lang="en">

<head>

? ? <meta charset="UTF-8">

? ? <title>Title</title>

? ? <style type="text/css">

? ? ? ? .box1{

? ? ? ? ? ? width: 300px;

? ? ? ? ? ? height: 400px;

? ? ? ? ? ? margin: 50px auto;

? ? ? ? ? ? border: 1px solid black;

? ? ? ? ? ? position: relative;

? ? ? ? ? ? /*overflow: hidden;*/

? ? ? ? }

? ? ? ? .pic{

? ? ? ? ? ? width: 300px;

? ? ? ? ? ? height: 400px;

? ? ? ? ? ? background-color: black;

? ? ? ? ? ? color: #fff;

? ? ? ? ? ? position: absolute;

? ? ? ? ? ? left: 300px;

? ? ? ? ? ? top: 0px;

? ? ? ? ? ? background-color:rgba(0,0 ,0 ,0.5);

? ? ? ? ? ? transition: all 500ms ease;

? ? ? ? ? ? display: none;

? ? ? ? }

? ? ? ? /* 將box1設(shè)置 overflow:hidden */

? ? ? ? /*.box1:hover {*/

? ? ? ? ? ? /*overflow: visible;*/

? ? ? ? ? ? /*!*top:150px*!*/

? ? ? ? /*}*/

? ? ? ? .box1:hover .pic{

? ? ? ? ? ? display: block;

? ? ? ? ? ? /*top:150px*/

? ? ? ? }

? ? </style>

</head>

<body>

<div class="box1">

? ? <img src="image/2.jpg" alt="接盤(pán)俠">

? ? <div class="pic">我是接盤(pán)俠</div>

</div>

</body>

</html>

附錄

css文件如下:

*{

? ? margin: 0;

? ? padding: 0;

}

.box1{

? ? width: 960px;

? ? height: 40px;

? ? background-color: #55a8ea;

? ? margin: 50px auto;

? ? position: relative;

}

.box1 ul{

? ? list-style: none;

}

.box1 li{

? ? width: 100px;

? ? height: 40px;

? ? float: left;

}

.box1 a{

? ? display: block;

? ? text-decoration: none;

? ? color: #fff;

? ? text-align: center;

? ? font: 14px 微軟雅黑;

? ? padding: 10px;

}

.box1 li:hover{

? ? background-color:#00619f ;

}

.box1 img{

? ? position: absolute;

? ? left: 430px;

? ? top:-10px;

}

.box2{

? ? width: 960px;

? ? height: 269px;

? ? border: 1px solid #cccccc;

? ? margin: 50px auto;

? ? /*position: relative;*/

}

h3{

? ? /*position: absolute;*/

? ? /*left: 35px;*/

? ? /*top:10px;*/

? ? padding: 12.6px 35px;

}

.box3{

? ? width: 920px;

? ? height: 219px;

? ? border-top:1px solid #cccccc ;

? ? margin: 0 20px;

? ? /*position: absolute;*/

? ? /*top:50px;*/

? ? /*left: 20px;*/

? ? /*position: relative;*/

}

.box4{

? ? width: 100px;

? ? border-top:1.5px solid red ;

}

.p1{

? ? float: left;

? ? padding: 20px 14.5px 5px 0;

}

.p2{

? ? float: left;

? ? padding: 20px 14.5px 5px 14.5px;

}

.p3{

? ? padding: 20px 0 5px 14.5px;;

}

.box2 img:hover{

? transform: translateY(-5px);

}

/*#p1{*/

? ? /*position: absolute;*/

? ? /*left: 0;*/

? ? /*top:20px;*/

/*}*/

/*#p2{*/

? ? /*position: absolute;*/

? ? /*left: 189px;*/

? ? /*top:20px;*/

/*}*/

/*#p3{*/

? ? /*position: absolute;*/

? ? /*left: 378px;*/

? ? /*top:20px;*/

/*}*/

/*#p4{*/

? ? /*position: absolute;*/

? ? /*left: 567px;*/

? ? /*top:20px;*/

/*}*/

/*#p5{*/

? ? /*position: absolute;*/

? ? /*left: 756px;*/

? ? /*top:20px;*/

/*}*/

/*#p6{*/

? ? /*position: absolute;*/

? ? /*left: 0;*/

? ? /*top:113px;*/

/*}*/

/*#p7{*/

? ? /*position: absolute;*/

? ? /*left: 189px;*/

? ? /*top:113px;*/

/*}*/

/*#p8{*/

? ? /*position: absolute;*/

? ? /*left: 378px;*/

? ? /*top:113px;*/

/*}*/

/*#p9{*/

? ? /*position: absolute;*/

? ? /*left: 567px;*/

? ? /*top:113px;*/

/*}*/

/*#p10{*/

? ? /*position: absolute;*/

? ? /*left: 756px;*/

? ? /*top:113px;*/

/*}*/

html文件如下:

<!DOCTYPE html>

<html lang="en">

<head>

? ? <meta charset="UTF-8">

? ? <title>Title</title>

? ? <link rel="stylesheet" type="text/css" href="css/4.css">

</head>

<body>

<div class="box1">

? ? <ul>

? ? ? ? <li><a href="#">首頁(yè)</a></li>

? ? ? ? <li><a href="#">網(wǎng)站建設(shè)</a></li>

? ? ? ? <li><a href="#">程序開(kāi)發(fā)</a></li>

? ? ? ? <li><a href="#">網(wǎng)絡(luò)營(yíng)銷(xiāo)</a></li>

? ? ? ? <li><a href="#">企業(yè)VI</a></li>

? ? ? ? <li><a href="#">案例展示</a></li>

? ? ? ? <li><a href="#">聯(lián)系我們</a></li>

? ? </ul>

? ? <img src="image/new.png">

</div>

<div class="box2">

? ? <h3>圖片展示</h3>

? ? <div class="box3">

? ? ? ? <div class="box4"></div>

? ? ? ? <img src="image/goods.jpg" class="p1">

? ? ? ? <img src="image/goods.jpg" class="p2">

? ? ? ? <img src="image/goods.jpg" class="p2">

? ? ? ? <img src="image/goods.jpg" class="p2">

? ? ? ? <img src="image/goods.jpg" class="p3">

? ? ? ? <img src="image/goods.jpg" class="p1">

? ? ? ? <img src="image/goods.jpg" class="p2">

? ? ? ? <img src="image/goods.jpg" class="p2">

? ? ? ? <img src="image/goods.jpg" class="p2">

? ? ? ? <img src="image/goods.jpg" class="p3">

? ? </div>

</div>

</body>

</html>

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 各種純css圖標(biāo) CSS3可以實(shí)現(xiàn)很多漂亮的圖形,我收集了32種圖形,在下面列出。直接用CSS3畫(huà)出這些圖形,要比...
    劍殘閱讀 9,979評(píng)論 0 8
  • 1. tab列表折疊效果 html: 能源系統(tǒng)事業(yè)部 崗位名稱(chēng): 工作地點(diǎn) 崗位名...
    lilyping閱讀 2,009評(píng)論 0 1
  • 不會(huì)用代碼框,所以看著有些亂套,,,,html部分 <!DOCTYPE html> 迅雷看看 ...
    這就是個(gè)帥氣的名字閱讀 1,913評(píng)論 0 0
  • 我的公共CSS文件@import "normalize.css";/begin主頁(yè)面//begin主頁(yè)面/body...
    藍(lán)色海洋_1982閱讀 1,294評(píng)論 0 0
  • 人的一生也就幾十年光景,再多也不過(guò)百年。在人生長(zhǎng)河中,能夠改變命運(yùn)的機(jī)會(huì)也就那么幾次,抓住了可能會(huì)走的順一點(diǎn),錯(cuò)過(guò)...
    624b05a7217f閱讀 400評(píng)論 0 1

友情鏈接更多精彩內(nèi)容