前端之选项卡

本文介绍了如何利用 JavaScript 代码实现前端交互中的选项卡功能,通过切换不同的内容区域,提供良好的用户体验。同时,文章可能还涉及了 CSS 样式的设置,以美化选项卡的显示效果。
摘要由CSDN通过智能技术生成

js 实现选项卡功能

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小米选项卡</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        a {
            text-decoration: none;
        }

        ul {
            list-style: none;
        }

        h1,h2,h3,h4,h5,h6 {
            font-weight: normal;
        }

        body {
            background-color: #f5f5f5;
        }

        .tab {
            width: 978px;
        }

        .tab .tit {
            height: 40px;
            line-height: 40px;
        }

        .tab .tit .a-wrapper {
            float: right;
        }
        .a-wrapper a {
            color: #666;
            margin-left: 20px;
        }
        .a-wrapper a.active {
            color: #FF7416;
            border-bottom: 2px solid #FF7416;
        }
        .content li {
            width: 234px;
            height: 300px;
            background: #fff;
            text-align: center;
            float: left;
            margin-right: 14px;
            position: relative;
            top: 0;
        }
        .content li:last-child {
            margin-right: 0;
        }
        .content li:hover {
            top: -2px;
            box-shadow: 0 15px 30px #ccc;
            transition: 0.3s;
        }
        .content .img-wrapper img {
            width: 160px;
        }
        .co
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序媛刘刘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值