html用css调整面板,tab面板,html+css

tab面板

*{

margin:0;

padding:0;

}

.tab{

width:/*盛放你的图片需要的宽度*/

overflow:hidden;

position:relative;

box-shadow:0 0 5px #888888;

}

ul{

overflow:hidden;

width:400%;/*所有图片的总宽度*/

transition:0.2s linear;

}

li{

float:left;

width:/*图片宽度自己设置*/

list-style:none;

}

img{

display:block;/*去除隐藏行距*/

width:100%;

}

input{

width:20px;

height:20px;

cursor:pointer;/*手型*/

position:absolute;

right:10px;

bottom:10px;

/*隐藏占位*/

visibility:hiddden;

z-index:200;

}

label{

width:20px;

height:20px;

cursor:pointer;/*手型*/

position:absolute;

right:10px;

bottom:10px;

/*隐藏占位*/

visibility:hiddden;

z-index:200;

text-align:center;

background-color:white;

}

/*位置的调整移动*/

.tab input:nth-of-type(4),label:nth-of-type{

transform:translateX(-30px);

}

.tab input:nth-of-type(3),label:nth-of-type{

transform:translateX(-60px);

}

.tab input:nth-of-type(2),label:nth-of-type{

transform:translateX(-90px);

}

.tab input:nth-of-type(1),label:nth-of-type{

transform:translateX(-120px);

}

.tab input:nth-of-type(1):checked ~ label:nth-of-type(1){

background-color:black;

color:white;

transform:translateX(-120px) scale(1.3);

opacity:0.5;

}

.tab input:nth-of-type(2):checked ~ label:nth-of-type(2){

background-color:black;

color:white;

transform:translateX(-90px) scale(1.3);

opacity:0.5;

}

.tab input:nth-of-type(3):checked ~ label:nth-of-type(3){

background-color:black;

color:white;

transform:translateX(-60 px) scale(1.3);

opacity:0.5;

}

.tab input:nth-of-type(4):checked ~ label:nth-of-type(4){

background-color:black;

color:white;

transform:translateX(-30px) scale(1.3);

opacity:0.5;

}

.tab input:nth-of-type(5):checked ~ label:nth-of-type(5){

background-color:black;

color:white;

transform:scale(1.3);

opacity:0.5;

}

/*图片的移动*/

.tab input:nth-of-type(1):checked ~ ul{

transform:translateX(0px);

}

.tab input:nth-of-type(2):checked ~ ul{

transform:translateX(-600px)

}

.tab input:nth-of-type(3):checked ~ ul{

transform:translateX(-1200px) ;

}

.tab input:nth-of-type(4):checked ~ ul{

transform:translateX(-1800px) ;

}

.tab input:nth-of-type(5):checked ~ ul{

transform:translateX(-2400px);

}

1

2

3

4

  • '></p><p align=
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值