這篇文章主要介紹“CSS3怎么實現(xiàn)自適應(yīng)全屏焦點圖切換特效”,在日常操作中,相信很多人在CSS3怎么實現(xiàn)自適應(yīng)全屏焦點圖切換特效問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”CSS3怎么實現(xiàn)自適應(yīng)全屏焦點圖切換特效”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
創(chuàng)新互聯(lián)建站于2013年成立,先為雁山等服務(wù)建站,雁山等地企業(yè),進行企業(yè)商務(wù)咨詢服務(wù)。為雁山企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務(wù)解決您的所有建站問題。
*{margin:0;padding:0;list-style: none;}
img.bg{min-width: 1024px;min-height: 100%;width: 100%;height: auto!important;height: 100%;position: fixed;top: 0;left: 0;z-index: 1;}
@media screen and (max-width: 1024px) {
img.bg{
left: 50%;
margin-left: -512px;
}
}
.slider{
position: absolute;
width: 100%;
text-align: center;
z-index: 999;
bottom: 100px;
}
.slider li{
display: inline-block;
width: 170px;
height: 130px;
margin-right: 15px;
}
.slider a{
display: inline-block;
width: 170px;
padding-top:70px;
padding-bottom:20px;
position: relative;
cursor: pointer;
border:2px solid #fff;
border-radius: 5px;
vertical-align: top;/*設(shè)置元素的垂直對齊方式。*/
color: #FFFFFF;
text-decoration: none;
font-size: 22px;
font-family: "楷體";
text-shadow: -1px -1px 1px rgba(0,0,0,0.8),
-2px -2px 1px rgba(0, 0, 0, 0.3),
-3px -3px 1px rgba(0, 0, 0, 0.3);
}
.slider li:nth-of-type(1) a{
background-color: #02646e;
}
.slider li:nth-of-type(2) a{
background-color: #eb0837;
}
.slider li:nth-of-type(3) a {
background-color: #67b374;
}
.slider li:nth-of-type(4) a {
background-color: #e6674a;
}
.slider li:nth-of-type(5) a {
background-color: #e61061;
}
.slider a::after{/*:after選擇器在被選元素的內(nèi)容后面插入內(nèi)容。*/
content: "";
display: block;
height: 120px;
width: 120px;
border:5px solid #fff;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -60px;
z-index: 9999;
top: -80px;
}
.slider li:nth-of-type(1) a::after {
/*:nth-of-type(n)選擇器匹配屬于父元素的特定類型的第 N個子元素的每個元素.*/
background: url(img/sbg1.jpg) no-repeat center;
}
.slider li:nth-of-type(2) a::after {
background: url(img/sbg2.jpg) no-repeat center;
}
.slider li:nth-of-type(3) a::after {
background: url(img/sbg3.jpg) no-repeat center;
}
.slider li:nth-of-type(4) a::after {
background: url(img/sbg4.jpg) no-repeat center;
}
.slider li:nth-of-type(5) a::after {
background: url(img/sbg5.jpg) no-repeat center;
}
.slider a::before{
content: "";
display: block;
height: 120px;
width: 120px;
border:5px solid #fff;
border-radius: 50%;
position: absolute;
left: 50%;
margin-left: -60px;
z-index: 99999;
top: -80px;
background:rgba(0,0,0,0.3);
}
.slider a:hover::before{
opacity: 0;
}
@-webkit-keyframes 'slideLeft'{
0%{
left:-500px;
}
100%{
left:0;
}
}
.slideLeft:target{
/*:target選擇器可用于選取當前活動的目標元素*/
z-index: 100;
animation: slideLeft 1s 1;
-webkit-animation: slideLeft 1s 1;
}
@-webkit-keyframes 'slideBottom'{
0%{
top:350px;
}
100%{
top:0;
}
}
.slideBottom:target{
/*:target選擇器可用于選取當前活動的目標元素*/
z-index: 100;
animation: slideBottom 1s 1;
-webkit-animation: slideBottom 1s 1;
}
@-webkit-keyframes 'zoomIn' {
0% {
-webkit-transform: scale(0.1);
}
100% {
-webkit-transform: none;
}
}
.zoomIn:target {
z-index: 100;
-webkit-animation: zoomIn 1s 1;
animation: zoomIn 1s 1;
}
/* Zoom Out */
@-webkit-keyframes 'zoomOut' {
0% {
-webkit-transform: scale(2);
}
100% {
-webkit-transform: none;
}
}
.zoomOut:target {
z-index: 100;
-webkit-animation: zoomOut 1s 1;
animation: zoomOut 1s 1;
}
/* Rotate */
@-webkit-keyframes 'rotate' {
0% {
-webkit-transform: rotate(-360deg) scale(0.1);
}
100% {
-webkit-transform: none;
}
}
.rotate:target {
z-index: 100;
-webkit-animation: rotate 1s 1;
animation: rotate 1s 1;
}
@-webkit-keyframes 'notTarget' {
0% {
z-index: 75;
}
100% {
z-index: 75;
}
}
.bg:not(:target) {
-webkit-animation: notTarget 1s 1;
animation: notTarget 1s 1
}
.page {
text-align:left;
}
到此,關(guān)于“CSS3怎么實現(xiàn)自適應(yīng)全屏焦點圖切換特效”的學習就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續(xù)學習更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
本文題目:CSS3怎么實現(xiàn)自適應(yīng)全屏焦點圖切換特效
本文來源:http://weahome.cn/article/jhgids.html