带 more 按钮的 tab 切换

本文详细介绍了如何使用 CSS 和 HTML 创建一个带有 'more' 按钮的 Tab 切换效果。通过 CSS3 的伪类选择器和灵活布局,实现了不同内容区域的切换,同时 'more' 按钮为用户提供额外内容的展示选项。

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

<!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>Document</title>
  <style>
    *{
     
      margin: 0;
      padding: 0;
    }
    ul {
     
      list-style: none;
    }
    a {
     
      color: #1b1b1b;
      text-decoration: none;
    }
    a:hover {
     
      color: #f00;
    }
    .fl {
     
      float: left;
    }
    .fr {
     
      float: right;
    }
    .container {
     
      width: 1000px;
      margin: 10px auto;
    }
    .tab-box{
     
      width: 495px;
      height:100%;
      border: 1px solid #ccc;
    }
    .menu {
     
      display: flex;
      justify-content: space-between;
      height:40px;
      width: 100%;
      border-bottom: 1px solid #ccc;
    }
    .menu .more{
     
      flex: 0 0 50px;
      line-height: 40px;
      text-align: center;
    }
    .menu .more a {
     
      display: none;
    }
    .menu ul {
     
      display:flex;
      flex: 1;
      height: 100%;
    }
    .menu ul li {
     
      flex: 0 0 80px;
      line-height: 40px;
      text-align: center;
    }
    .current {
     
      color: #fff;
      background-color: #4e6ef2;
    }
    .content {
     
      padding: 10px;
    }
    .show {
     
      display: block !important;
    }
    .hidden {
     
      display: none !important;
    }
    .content li{
     
      line-height: 30px;
      width:475px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .content ul {
     
      display: none;
    }
   .current a{
     
      color: #fff
    }
    
  </style>
</head>
<body>
  
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值