本篇內(nèi)容介紹了“ Css3怎么做響應(yīng)式布局”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
創(chuàng)新互聯(lián)主要從事成都網(wǎng)站建設(shè)、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)衡南,10多年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢建站服務(wù):18980820575
Css3操作響應(yīng)式布局
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{padding: 0;margin: 0;}
html,body{width: 100%;height: 100%;background:url(img/bj.jpg) ;background-size: 100% 100%;}
#nav{width: 560px;height:40px ;margin: 10px auto;}
ul,li{list-style: none;}
.list{width: 560px;height: 40px;background: #fff;}
.list li{width: 50px;height: 40px;margin: 0 10px;float: left;
transition: all 1s;
}
.list li:nth-child(1){
background: url(img/1.png) top;
}
.list li:nth-child(2){
background: url(img/2.png) top;
}
.list li:nth-child(3){
background: url(img/3.png) top;
}
.list li:nth-child(4){
background: url(img/4.png) top;
}
.list li:nth-child(5){
background: url(img/5.png) top;
}
.list li:nth-child(6){
background: url(img/6.png) top;
}
.list li:nth-child(7){
background: url(img/7.png) top;
}
.list li:nth-child(8){
background: url(img/8.png) top;
}
.list li:hover{
background-position: bottom;
}
@media only screen and (min-width: 640px) and (max-width: 980px) {
#nav{position: fixed;top:100px;left:10px;width: 50px;height:400px ;margin: 10px auto;}
ul,li{list-style: none;}
.list{width: 67px;height: 400px;background: #fff;}
.list li{width: 50px;height: 40px;margin: 0 10px;float: left;
transition: all 1s;
}
}
@media only screen and (min-width: 100px) and (max-width: 640px) {
#nav{position: fixed;top:100px;left:10px;width: 50px;height:400px ;margin: 10px auto;}
ul,li{list-style: none;}
.list{width: 67px;height: 400px;background: red;}
/*.list li{width: 50px;height: 40px;margin: 0 10px;float: left;
transition: all 1s;
background: #fff;
}*/
.list li:nth-child(1){
background: url(img/1.png) top;
}
.list li:nth-child(2){
background: url(img/2.png) top;
}
.list li:nth-child(3){
background: url(img/3.png) top;
}
.list li:nth-child(4){
background: url(img/4.png) top;
}
.list li:nth-child(5){
background: url(img/5.png) top;
}
.list li:nth-child(6){
background: url(img/6.png) top;
}
.list li:nth-child(7){
background: url(img/7.png) top;
}
.list li:nth-child(8){
background: url(img/8.png) top;
}
.list li:hover{
background-position: bottom;
}
.list li{width: 50px;height: 40px;margin: 0 10px;float: left;
transition: all 1s;
border-radius: 50%;
}
}
</style>
</head>
<body>
<div id="nav">
<ul class="list">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>
效果截圖
“ Css3怎么做響應(yīng)式布局”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
文章題目:Css3怎么做響應(yīng)式布局
本文地址:http://www.muchs.cn/article26/ishsjg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、網(wǎng)站內(nèi)鏈、移動(dòng)網(wǎng)站建設(shè)、商城網(wǎng)站、網(wǎng)站收錄、品牌網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)