web前端html+css常用布局05列表布局


web前端html+css常用布局05列表布局

注意:引入jquery的jquery-2.1.4.min.js包

图片从自己目录中路径。


代码:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="jquery-2.1.4.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        h3{
            color: #666;
            font-weight: 600;
            font-size: 18px;
        }
        body{
            background-color: #f4f4f4;
        }
        .myContents{
            width: 1200px;
            margin: 0 auto;
            margin-bottom: 20px;
            background-color: #fff;
        }
        .mylist {
            width: 1180px;
            height: 200px;
            margin: 0 auto;
            padding: 20px 30px 20px 30px;

        }

        .p1, .p2, .ptime {
            font-family: "微软雅黑";
            color: #999;
        }
        .p1, .p2 ,.ptime{
            font-size: .875em;
        }
        .listLeft {
            width: 260px;
            height: 180px;
            float: left;
            margin-top: 10px;
        }

        .listLeft .listImage {
            width: 260px;
            height: 180px;
        }

        .listRight {
            width: 860px;
            height: 200px;
            float: left;
            margin-left: 20px
        }

        .myTitle {
            margin-top: 0;
        }

        h3 {
            float: left;
            margin-top: 0px;
        }

        .p1 {
            margin-top: 45px;
            line-height: 200%;
            /*左右对齐*/
            text-align: justify;
            max-height: 113px;
            min-height: 113px
        }

        .p2 {
            margin-top: 16px;
        }

        .p2 a {
            /*去掉下划线*/
            text-decoration: none;
            color: #3587c6;

        }

        .ptime {
            float: right;
        }
        .page-location{padding: 20px 0;font-size: 12px;color: #666;  margin-left: 30px}
        .page-location a{display: inline;color: #3487c4}
        .page-location span{color: #333}

        .pagination{position: relative;height: 30px;padding-bottom: 40px;}
        .pagination ul{position: absolute;right: 0;top: 0; list-style: none}
        .pagination li{cursor:pointer;float: left;height:26px;width: 26px;color: #666;line-height:26px;text-align: center;border-radius: 2px; }
        .pagination li.active{background-color:#3587c6;color: #fff }
        .pagination { margin-right: 30px;}
    </style>
</head>
<body>

<div class="myContents">
    <div class="page-location">您现在的位置:<a href="#"> 掌上贵金属</a> &gt;<a href="#"> 新手学院</a> &gt; <span>列表页</span></div>
    <div class="mylist">

        <div class="listLeft">
            <img class="listImage"src="images/img01.jpg">
            </img>
        </div>
        <div class="listRight">
            <div class="myTitle">
                <h3>天津贵金属交易所</h3>

                <p class="ptime">2015-5-12</p>
            </div>
            <p class="p1">
                以下简称“津贵所”)是根据国务院关于《推进滨海新区开发开放有关问题的意见》
                (国发﹝2006﹞20号)的政策精神,经天津市政府批准,由天津产权交易中心发起设立的公司制交易所。
                津贵所注册资本金为一亿元人民币,由中国中信集团控股,天津产权交易中心、中国黄金集团公司等企业参股
                中国黄金集团公司等企业参股
            </p>

            <p class="p2"><a href="#">查看全文</a></p>
        </div>
    </div>

    <div class="pagination">
        <ul class="clearfix">
            <li class="active">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
            <li>6</li>
            <li>7</li>
            <li>8</li>
            <li>9</li>
        </ul>
    </div>
</div>


</div>
<script type="text/javascript">
    $(function() {
        $(".pagination li").click(function() {
            var index = $(this).index();
            $(".pagination li").removeClass("active");
            $(".pagination li").eq(index).addClass("active");
        })
    })
</script>

</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值