html选项卡如何美化,Bootstrap超酷Tabs选项卡美化特效

本文介绍了一种使用Bootstrap和CSS3实现的超酷选项卡美化特效。通过添加特定的HTML结构和CSS样式,可以创建具有动态背景渐变和居中对齐的选项卡。在响应式设计方面,该方案还考虑了在小屏幕设备上的显示效果。

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

这是一款基于Bootstrap的超酷Tabs选项卡美化特效。该Tabs选项卡在原生Bootstrap选项卡的基础上,使用CSS3样式来对齐进行美化,效果非常炫酷。

使用方法

在页面中引入bootstrap相关文件和jquery文件。

HTML结构

该Tabs选项卡的HTML结构如下。

Section 1

......

Section 2

......

Section 3

......

CSS样式

为该Tabs选项卡添加下面的CSS样式:

a:hover,a:focus{

outline: none;

text-decoration: none;

}

.tab .nav-tabs{

position: relative;

border-bottom: 0 none;

}

.tab .nav-tabs li{

text-align: center;

}

.tab .nav-tabs li a{

display: block;

height: 70px;

line-height: 65px;

background: linear-gradient(165deg, transparent 29%, #908a78 30%);

font-size: 15px;

font-weight: 600;

color: #fff;

text-transform: uppercase;

margin-right: 0;

border-radius: 0;

border: none;

position: relative;

transition: all 0.5s ease 0s;

}

.tab .nav-tabs li.active a,

.tab .nav-tabs li a:hover{

background: linear-gradient(165deg, transparent 29%, #efe8d5 30%);

border: none;

color: #908a78;

}

.tab .nav-tabs li a:before{

content: "";

height: 70px;

line-height: 90px;

border-bottom: 70px solid rgba(0, 0, 0, 0.1);

border-right: 10px solid transparent;

position: absolute;

top: 0;

left: 100%;

z-index: 1;

}

.tab .nav-tabs li:last-child a:before{

border: none;

}

.tab .tab-content{

font-size: 14px;

color: #6f6c6c;

line-height: 26px;

background: #efe8d5;

padding: 20px;

}

.tab .tab-content h3{

font-size: 24px;

color: #6f6c6c;

margin-top: 0;

}

.tab .tab-content p{

margin-bottom: 0;

}

@media only screen and (max-width: 480px){

.tab .nav-tabs li{

width: 100%;

margin-bottom: 8px;

}

.tab .nav-tabs li:last-child{

margin-bottom: 0;

}

.tab .nav-tabs li a:before{

border: none;

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值