h5页面分享一(附源码)

1. 页面效果

h5页面分享一(附源码)_第1张图片

2. index.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 LIFEdiv>
            <button>LOOK MORE >button>
        div>
        <div class="middle">
            <div class="m-top">
                <div class="commen weibo">
                    <img src="img/weibo.png" alt="weibologo">
                    <div class="comm">MICROBLOGdiv>
                div>
                <div class="commen wechat">
                    <img src="img/weixin.png" alt="weixinlogo">
                    <div class="comm">WECHATdiv>
                div>
                <div class="commen qq">
                    <img src="img/QQ.png" alt="qqlogo">
                    <div class="comm">QQdiv>
                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 Imagediv>
                    <div class="des2">Record The Picturediv>
                div>
                <div class="m-com">
                    <img src="img/03-02.jpg" alt="03-02.jpg">
                    <div class="des1">Great Picturediv>
                    <div class="des2">Record The Picturediv>
                div>
                <div class="m-com">
                    <img src="img/03-03.jpg" alt="03-03.jpg">
                    <div class="des1">Cool Imagediv>
                    <div class="des2">Record The Picturediv>
                div>
            div>
        div>
        <div class="clear">div>
        <div class="bottom">
            <div class="b-title">FROM THE PHOTO ALBUMdiv>
            <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">
        © 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. 欢迎改进

你可能感兴趣的:(//【编程语言】,前端html相关)