文本自适应 某宽度 超出后实现翻页

本文探讨如何在文本宽度超出指定限制时,通过翻页技术进行内容展示。讲解了关键技术和实现步骤,帮助读者理解如何优雅地处理长文本显示问题。
摘要由CSDN通过智能技术生成

实现效果

<!DOCTYPE html>
<html>

<head>
    <title></title>
    <link rel="stylesheet" href="../../js/bootstrap/css/bootstrap.min.css">
    <style type="text/css">
    .tabs {
        width: 100%;
        border-bottom: 1px solid #20eeff;
        height: 50px;
        overflow: hidden;
    }

    .tabs-lines {
        width: auto;
        margin: auto;
        position: relative;
        height: 100%;
        white-space: nowrap;
        overflow: visible;
    }

    .tab-item {
        cursor: pointer;
        display: inline-block;
        height: 50px;
        margin-right: 20px;
        text-align: center;
        color: #333;
        font-size: 16px;
    }

    .tab-wrap {
        display: inline-block;
        width: 90%;
        margin-left: 20px;
        line-height: 50px;
        height: 50px;
        position: relative;
        overflow: hidden;
    }

    .tab-button {
        display: inline-block;
        background: transparent;
        border: none;
        width: 40px;
        height: 50px;
        line-height: 50px;
        color: #ccc;
        cursor: pointer;
        vertical-align: top;
        outline: none;
        cursor: not-allowed;
    }

    .tab-button-active {
        color: #20eeff;
        cursor: pointer;
    }

    .tab-checked {
        color: #20eeff;
        border-bottom: 6px solid #1DA9C5;
    }

    .tab-item span {
        display: inline-block;
    }

    .tab-content {
        margin-top: 20px;
    }
    </style>
</head>

<body>
    <div class="tabs">
        <div class="tab-wrap">
            <div class="tabs-lines">
            </div>
        </div>
        <button id="left" class="tab-button">
            <span class="glyphicon glyphicon glyphicon-triangle-left"></span>
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值