页面改成html5,【改】 html5 中tab页面的简单转换

本文介绍了一种使用 CSS3 实现的美观且具备淡入淡出效果的 Tab 菜单。该菜单通过 HTML 和 CSS3 的特性实现了交互式的选项卡布局,能够平滑地切换不同的面板内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

.tabs {

width: 100%;

max-width: 455px;

float: left;

}

#div1 input {

opacity: 0;

border: 1px solid #F0F0F0

}

#div1 label {

cursor: pointer;

background: -webkit-linear-gradient();

color: #FBFBFF;

border-radius: 5px 5px 0 0;

padding: 1.5% 3%;

float: left;

margin-right: 2px;

font: italic 1em cambria;

border: 1px solid #F0F0F0;

border-bottom-width: 0px;

}

#div1 label:hover {

background: -webkit-linear-gradient(#ECFFFF,#FDFFFF);

}

#div1 input:checked + label {

background:#ECF5FF;

color: #333;

}

.tabs input:nth-of-type(1):checked ~ .panels .panel:first-child,

.tabs input:nth-of-type(2):checked ~ .panels .panel:nth-child(2),

.tabs input:nth-of-type(3):checked ~ .panels .panel:nth-child(3),

.tabs input:nth-of-type(4):checked ~ .panels .panel:last-child {

opacity: 1;

-webkit-transition: .3s;

}

.panels {

float: left;

clear: both;

position: relative;

width: 100%;

background: #fff;

border-radius: 0 10px 10px 10px;

min-height: 480px;

border: 1px solid #F0F0F0;

}

.panel {

width: 100%;

opacity: 0;

position: absolute;

background: #fff;

border-radius: 0 10px 10px 10px;

padding: 4%;

box-sizing: border-box;

}

.panel h2 {

margin: 5px;

font-family: Arial;

}

css前端样式设置。

下边是html5页面:

CSS3外观漂亮淡入淡出Tab菜单演示

Tab One

Tab Two

Tab Three

Tab Four

div1

div2

div3

div4

44004707629719b4d03b8377cf3ee357.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值