h5页面分享一(附源码)

发布于:2023-04-28 ⋅ 阅读:(177) ⋅ 点赞:(0)

源码地址(含素材)https://github.com/zhangzhuo233/html_php_code/tree/master/html/%E7%BD%91%E9%A1%B5%E5%B8%83%E5%B1%80%E6%A1%88%E4%BE%8B

###1. 页面效果
这里写图片描述
###2. index.html

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>css网页布局</title>
    <link rel="stylesheet" href="css/index.css">
</head>
<body>
<!--整体到部分,左到右,上到下-->
    <!--头部-->
    <div class="header">
        <div class="logo">
            <img src="img/logo.png" alt="logo">
        </div>
        <div class="nav">
            <ul>
                <li>手记</li>
                <li>视频</li>
                <li>图片</li>
                <li>首页</li>
            </ul>
        </div>
    </div>
    <!--主体-->
    <div class="main">
        <div class="top">
            <img src="img/1.jpeg" alt="topimg">
        </div>
        <!--遮罩层-->
        <div class="topplayer"></div>
        <!--最上层的内容-->
        <div class="topplayer-top">
            <div class="word">MY BEAUTIFUL LIFE</div>
            <button>LOOK MORE &gt;</button>
        </div>
        <div class="middle">
            <div class="m-top">
                <div class="commen weibo">
                    <img src="img/weibo.png" alt="weibologo">
                    <div class="comm">MICROBLOG</div>
                </div>
                <div class="commen wechat">
                    <img src="img/weixin.png" alt="weixinlogo">
                    <div class="comm">WECHAT</div>
                </div>
                <div class="commen qq">
                    <img src="img/QQ.png" alt="qqlogo">
                    <div class="comm">QQ</div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="m-middle">
                "I want to give good things to record down,<br>after the recall will be very beautiful."
            </div>
            <div class="m-bottom">
                <div class="m-com">
                    <img src="img/03-01.jpg" alt="03-01.jpg">
                    <div class="des1">Cool Image</div>
                    <div class="des2">Record The Picture</div>
                </div>
                <div class="m-com">
                    <img src="img/03-02.jpg" alt="03-02.jpg">
                    <div class="des1">Great Picture</div>
                    <div class="des2">Record The Picture</div>
                </div>
                <div class="m-com">
                    <img src="img/03-03.jpg" alt="03-03.jpg">
                    <div class="des1">Cool Image</div>
                    <div class="des2">Record The Picture</div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <div class="bottom">
            <div class="b-title">FROM THE PHOTO ALBUM</div>
            <div class="pic-content">
                <dl>
                    <dt><img src="img/04-01.jpg" alt="04-01"></dt>
                    <dd class="word">
                        Life is like a book, just read more and more refined, more write more carefully. When read, mind open, all things have been indifferent to heart. Life is the precipitation.
                    </dd>
                </dl>
                <dl>
                    <dt><img src="img/04-02.jpg" alt="04-01"></dt>
                    <dd class="word">
                        Life is like a book, just read more and more refined, more write more carefully. When read, mind open, all things have been indifferent to heart. Life is the precipitation.
                    </dd>
                </dl>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    <!--底部-->
    <div class="footer">
        &copy 2016 imooc.com  京ICP备13046642号
    </div>
</body>
</html>

###3. index.css

*{
    margin: 0;
    padding: 0;
}
.header{
    width: 100%;
    height: 100px;
    /*background: #eeeeee;*/
}
.header img{
    width: 300px;
    height: 85px;
    padding-left: 100px;
    padding-top: 8px;
}
.header .logo{
    float: left;
}
.header .nav{
    float: right;
}
.header .nav ul{
    margin-right: 100px;
}
.header .nav ul li{
    float: left;
    list-style: none;
    width: 80px;
    height: 100px;
    line-height: 100px;
    color: #7d7d7d;
    font-size: 15px;
    font-weight: bolder;
}
.main .top{
    width: 100%;
    height: 600px;
}
.main .top img{
    width: 100%;
    height: 600px;
}
.main .topplayer{
    position: absolute;
    top: 100px;
    background: #000000;
    width: 100%;
    height: 600px;
    opacity: 0.5;/*透明度*/
}
.main .topplayer-top{
    /*background: aqua;*/
    width: 500px;
    height: 300px;
    position: absolute;
    top: 400px;
    margin-top: -150px;
    z-index: 2;
    right: 50%;
    margin-right: -250px;
}
.main .topplayer-top .word{
    padding-top: 100px;
    color: #ffffff;
    font-size: 45px;
    font-weight: bolder;
    text-align: center;
    font-family: "微软雅黑";
}
.main .topplayer-top button {
    width: 200px;
    height: 60px;
    margin-top: 50px;
    color: #ffffff;
    background: #f5704f;
    font-family: 微软雅黑;
    text-align: center;
    font-weight: bolder;
    font-size: 14px;
    border-radius: 8px; /*圆角*/
    margin-left: 150px;
}
.main .middle{
    width: 1000px;
    margin: 0 auto;
}
.main .middle .m-top .commen{
    float: left;
    width: 33.3%;
    padding-top: 50px;
    text-align: center;
}
.main .middle .m-top .commen img{
    width: 100px;
    height: 100px;
}
.main .middle .m-top .commen .comm{
    font-size: 20px;
    color: #7d7c7f;
    font-weight: bold;
    padding-top: 20px;
}
.main .middle .m-middle{
    font-size: 22px;
    color: #E19796;
    font-weight: bold;
    padding-top: 50px;
    font-style: italic;
    text-align: center;
    padding-bottom: 50px;
}
.clear{
    clear: both;
}
.main .middle .m-bottom .m-com{
    float: left;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
}
.main .middle .m-bottom .m-com img{
    width: 310px;
    height: 260px;
}
.main .middle .m-bottom .des1{
    padding-top: 20px;
    color: #7d7d7f;
}
.main .middle .m-bottom .des2{
    padding-top: 10px;
    color: #bdbdbc;
}
.main .bottom{
    width: 1000px;
    margin: 0 auto;
}
.main .bottom .b-title{
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #7d7c7f;
    font-family: "微软雅黑";
    padding-top: 50px;
    padding-bottom: 50px;
}
.main .bottom .pic-content dl{
    float: left;
    width: 470px;
    margin: 10px 12px;
}
.main .bottom .pic-content dl img{
    width: 470px;
    height: 460px;
}
.main .bottom .pic-content dl .word{
    padding-top: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #7d7c7f;
    padding-bottom: 50px;
}
.footer{
    width: 100%;
    height: 100px;
    text-align: center;
    line-height: 100px;
    background: #292c35;
    color: white;
    font-family: "微软雅黑";
    font-size: 15px;

}

###4. 欢迎改进

本文含有隐藏内容,请 开通VIP 后查看

网站公告

今日签到

点亮在社区的每一天
去签到