zoukankan      html  css  js  c++  java
  • 移动端横向滚动

    <!DOCTYPE html>
    <html lang="zh-cn">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            body{
                background-color: #ccc;
            }
            .s-header{
                overflow: hidden;
                height: 40px;
            }
            .s-header div:nth-child(1){
                float: left;
                margin-left: 20px;
                margin-top: 9px;
                font-size: 10px;
            }
            .s-header div:nth-child(2){
                float: right;
                margin-right: 20px;
                margin-top: 9px;
                border:1px solid #000;
                padding: 4px;
                border-radius: 12px;
                font-size: 10px;
            }
            .s-con{
                height: 172px;
                display: -webkit-box;
                overflow-x: scroll;
                -webkit-overflow-scrolling:touch;            
            }
            .swiper{
                height: 164px;
                 280px;
                background: url('./1.png') no-repeat;
                background-size: 100% 100%;
                position: relative;
                margin: 4px;
            }
            .swiper .c1 {
                position: absolute;
                bottom: 0;
                left: 0;
                 100%;
                background-color:rgba(0,0,0,0.3);
            }
            .swiper .c1 .zhi{
                overflow: hidden;
                text-overflow: ellipsis;
                -o-text-overflow: ellipsis;
                white-space: nowrap;
                 200px;
                margin: 0;
            }
            .swiper .c1  .icon{
                 100%;
                overflow: hidden;
            }
            .left{
                float: left;
            }
            .right {
                float:right;
            }
        </style>
    </head>
    <body>
        <div class="content">
            <div class="s-header">
                <div>周边动态</div>
                <div>全部动态</div>
            </div>
            <div class="s-con">
                    <div class="swiper">
                        <!-- 下面的内容 -->
                        <div class="c1">
                            <div class="zhi">嘻嘻嘻嘻嘻嘻嘻嘻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻</div>
                            <div class="icon">
                                <div class="left">
                                    <i>左</i>
                                    <i>左</i>
                                </div>
                                <div class="right">
                                    <i>右</i>
                                    <i>右</i>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="swiper">
                        <!-- 下面的内容 -->
                        <div class="c1">
                            <div class="zhi">嘻嘻嘻嘻嘻嘻嘻嘻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻</div>
                            <div class="icon">
                                <div class="left">
                                    <i>左</i>
                                    <i>左</i>
                                </div>
                                <div class="right">
                                    <i>右</i>
                                    <i>右</i>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="swiper">
                            <!-- 下面的内容 -->
                            <div class="c1">
                                <div class="zhi">嘻嘻嘻嘻嘻嘻嘻嘻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻</div>
                                <div class="icon">
                                    <div class="left">
                                        <i>左</i>
                                        <i>左</i>
                                    </div>
                                    <div class="right">
                                        <i>右</i>
                                        <i>右</i>
                                    </div>
                                </div>
                            </div>
                    </div>
                    <div class="swiper">
                        <!-- 下面的内容 -->
                        <div class="c1">
                            <div class="zhi">嘻嘻嘻嘻嘻嘻嘻嘻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻</div>
                            <div class="icon">
                                <div class="left">
                                    <i>左</i>
                                    <i>左</i>
                                </div>
                                <div class="right">
                                    <i>右</i>
                                    <i>右</i>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="swiper">
                            <!-- 下面的内容 -->
                            <div class="c1">
                                <div class="zhi">嘻嘻嘻嘻嘻嘻嘻嘻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻</div>
                                <div class="icon">
                                    <div class="left">
                                        <i>左</i>
                                        <i>左</i>
                                    </div>
                                    <div class="right">
                                        <i>右</i>
                                        <i>右</i>
                                    </div>
                                </div>
                            </div>
                    </div>
                    <div class="swiper">
                        <!-- 下面的内容 -->
                        <div class="c1">
                            <div class="zhi">嘻嘻嘻嘻嘻嘻嘻嘻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻寻</div>
                            <div class="icon">
                                <div class="left">
                                    <i>左</i>
                                    <i>左</i>
                                </div>
                                <div class="right">
                                    <i>右</i>
                                    <i>右</i>
                                </div>
                            </div>
                        </div>
                    </div>
            </div>
        </div>
        <script>
            
            
        </script>
    </body>
    </html>
  • 相关阅读:
    Unity shader with lightmap
    清理数据库日志
    Sqlserver数据库还原一直显示“正在还原…”解决方法
    如何查看 SQL Server 执行的历史 SQL 语句记录?
    MYSQL 命令行大全 (简洁、明了、全面)
    C#Datatable导入sqlserver数据库中,三种常见,快捷的方法
    MongoDB下载页面
    等级保护和分级保护区别与联系
    等级保护和分级保护
    SQL2005EXPress自动备份
  • 原文地址:https://www.cnblogs.com/Alitar/p/10749622.html
Copyright © 2011-2022 走看看