慕课网——CSS作业练习题

作业地址:点击打开链接

html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css慕课网作业</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
    <!-- 顶部 -->
    <div class="top">
        <!-- logo -->
        <div class="logo">
            <a href="#"><img src="img/logo.png" alt="logo"></a>
        </div>
        <!-- 右侧导航 -->
        <div class="nav">
            <ul>
                <li><a href="#">HOME</a></li>
                <li><a href="#">ABOUT</a></li>
                <li><a href="#">GALLERY</a></li>
                <li><a href="#">FACULTY</a></li>
                <li><a href="#">EVENTS</a></li>
                <li><a href="#">CONTACT</a></li>
            </ul>
        </div>
    </div>

    <!-- banner -->
    <div class="banner">
        <!-- 背景图片 -->
        <img src="img/banner3.jpg" alt="banner">
        <!-- 遮罩层 -->
        <div class="topLayer"></div>
        <!-- 最上层内容 -->
        <div class="btn">
            <form action="">
                <input type="text" name="username" placeholder="your Name">
                <input type="text" name="userphone" placeholder="your Phone">
                <input type="text" name="useremail" placeholder="your Email">
                <textarea name="comment" placeholder="Write Your Comment Here" class="textarea"></textarea>
                <button>SEAD MESSAGE</button>
            </form>
        </div>
    </div>
    <!-- about区 -->
    <div class="about">
        <!-- about上半部分 -->
        <div class="about-top">
            <div class="about-top-content">
                <div class="about">ABOUT</div>
                <i class="i"></i>
                <div class="text1">Lorem Ipsum is simply dummy text of the printing and typesetting <br/>industry.Lorem Ipsum has been the industry's standard dummy <br/>text ever since the 1500s</div>
                <span class="word">A WORD <br/>ABOUT US</span>
                
                <div class="pic"><img src="img/bb3.jpg" alt="pic"></div>

                <div class="text2">
                    <div class="text2-content">
                          <p>Praesent dignissim viverra est,sed <br/> bibendum ligula congue non.Sed ac nisl <br/>et felis gravida commodo?Suspendisse<br/>eget ullamcorper ipsum.Suspendisse<br/>diam amet</p>
                          <button>EXPLOER</button>
                    </div>
                </div>

                <div class="student">
                    <span class="tit">70000</span>
                    <i class="i"></i>
                    <span class="txt">Students</span>
                </div>

                <div class="faculty">
                    <span class="tit">600</span>
                    <i class="i"></i>
                    <span class="txt">Faculty</span>
                </div>
            </div>
        </div>
        <!-- about下半部分 -->
        <div class="about-bottom">
           <div class="about-item item1"></div>
           <div class="about-item item2">
               <div class="about-item-content">
                   <span class="title">Library</span>
                   <p class="content-1">Lorem Ipsum is simply dummy text of the <br/>printing and typesetting industry</p>
                   <p class="content-2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unkonw printer tool a  galley of type and scrambled it to make a type specimen book.</p>
                   <button>EXPLOER</button>
               </div>
           </div>
           <div class="about-item item3"></div>
           <div class="about-item item4">
               <div class="about-item-content">
                   <span class="title">Computer Lab</span>
                   <p class="content-1">Lorem Ipsum is simply dummy text of the <br/>printing and typesetting industry</p>
                   <p class="content-2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unkonw printer tool a  galley of type and scrambled it to make a type specimen book.</p>
                   <button>EXPLOER</button>
               </div>
           </div>
           <div class="about-item item5">
               <div class="about-item-content">
                   <span class="title">Conference Hall</span>
                   <p class="content-1">Lorem Ipsum is simply dummy text of the <br/>printing and typesetting industry</p>
                   <p class="content-2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unkonw printer tool a  galley of type and scrambled it to make a type specimen book.</p>
                   <button>EXPLOER</button>
               </div>
           </div>
           <div class="about-item item6"></div>
           <div class="about-item item7">
               <div class="about-item-content">
                   <span class="title">Play Ground</span>
                   <p class="content-1">Lorem Ipsum is simply dummy text of the <br/>printing and typesetting industry</p>
                   <p class="content-2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unkonw printer tool a  galley of type and scrambled it to make a type specimen book.</p>
                   <button>EXPLOER</button>
               </div>
           </div>
           <div class="about-item item8"></div>
        </div>
    </div>
   <!-- gallery区 -->
    <div class="gallery">
        <div class="gallery-top">
            <div class="about">GALLERY</div>
            <i class="i"></i>
            <div class="text1">Lorem Ipsum is simply dummy text of the printing and typesetting <br/>industry.Lorem Ipsum has been the industry's standard dummy <br/>text ever since the 1500s</div>
        </div> 
        <div class="gallery-bottom">
            <div class="gallery-bottom-item">
                <div class="gallery-pic pic1"><img src="img/03-01.jpg" alt="pic"></div>
                <div class="gallery-bottom-top">  SCIENCE LAB</div>
            </div>
            <div class="gallery-bottom-item">
                <div class="gallery-pic pic2"><img src="img/03-02.jpg" alt="pic"></div>       
                <div class="gallery-bottom-top">  INDOOR STADIUM</div>
            </div>
            <div class="gallery-bottom-item">
                <div class="gallery-pic pic3"><img src="img/03-03.jpg" alt="pic"></div>       
                <div class="gallery-bottom-top">  TRANSPORTATION</div>
            </div>
            <div class="gallery-bottom-item">
                <div class="gallery-pic pic4"><img src="img/03-04.jpg" alt="pic"></div>
                <div class="gallery-bottom-top">  KIDS ROOM</div>
            </div>
            <div class="gallery-bottom-item">
                <div class="gallery-pic pic5"><img src="img/03-05.jpg" alt="pic"></div>
                <div class="gallery-bottom-top">  MEDITATION CLASSES</div>
            </div>
            <div class="gallery-bottom-item">
                <div class="gallery-pic pic6"><img src="img/03-06.jpg" alt="pic"></div>
                <div class="gallery-bottom-top">  KIDS PLAYGROUND</div>
            </div>
        </div> 
    </div>
    <!-- footer区 -->
    <div class="footer">
        <p>&copy;2016 imooc.com 京ICP备13046642号</p>
    </div>
</body>
</html>

CSS:

/*css reset*/
* {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei UI";
    list-style: none;
}

a {
    text-decoration: none;
    color: #fff;
}

/*通用样式设置*/
.i {
    display: block;
    height: 3px;
    width: 40px;
    background-color: #07cbc9;
    margin: 0 auto;
    text-align: center;
    margin-bottom: 15px;
} 

/*top样式*/
.top {
    width: 100%;
    height: 80px;
    background: #07cbc9;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9;
}

.top .logo {
    width: 250px;
    height: 60px;
    position: absolute;
    top: 50%;
    margin-top: -30px;
    margin-left: 80px;
}

.top .nav {
    height: 80px;
    float: right;
}

.top .nav ul {
    margin-right: 80px;
}

.top .nav li {
    float: left;
    width: 80px;
    line-height: 80px;
    font-weight: bold;
    text-align: center;
    padding-left: 5px;
    cursor: pointer;
}

.top .nav li:hover {
    background: #333;
}

/*banner样式*/
.banner {
    height: 500px;
    width: 100%;
    position: relative;
    margin-top: 80px;
}

.banner img {
    height: 500px;
    width: 100%;
    position: relative;
}
.banner .topLayer {
    background-color: #000;
    opacity: 0.5;
    z-index: 1;
    position: absolute;
    top: 0;
    height: 500px;
    width: 100%;
}

.banner .btn {
    width: 400px;
    height: 300px;
    position: absolute;
    top: 50%;
    margin-top: -150px;
    left: 50%;
    margin-left: -200px;
    z-index: 2;
}

.banner .btn form {
    width: 400px;
    height: 300px;
}

.banner .btn input {
    width: 398px;
    height: 30px;
    background: transparent;
    margin-bottom: 15px; 
    outline: none;
    border-color: #ccc;
    color: #fff;
}

.banner .btn textarea {
    width: 100%;
    height: 80px;
    background: transparent;
    margin-bottom: 20px;
    outline: none;
    border-color: #ccc;
    color: #fff;
}

.banner .btn button {
    display: block;
    margin: 0 auto;
    width: 120px;
    height: 40px;
    text-align: center;
    background: transparent;
    outline: none;
    border-color: #ccc;
    color: #fff;
    cursor: pointer;
}

.banner .btn input:hover,
.banner .btn textarea:hover {
    border-color: #07cbc9;
}

.banner .btn button:hover {
    background-color: #07cbc9;
    border: none;
}

/*about样式*/
.about  {
    position: relative;
    height: 1000px;
}

.about .about-top {
    height: 500px;
    background: #fff;
    position: relative;
}

.about .about-top-content {
    width: 800px;
    height: 400px;
    position: absolute;
    top: 50%;
    margin-top: -200px;
    left: 50%;
    margin-left: -400px;
}

.about .about-top-content .about {
    width: 100%;
    height: 50px;
    text-align: center;
    font-size: 40px;
    font-weight: bold; 
}

.about .about-top-content .text1 {
    width: 400px;
    height: 80px;
    text-align: center;
    font-size: 12px;
    margin: 0 auto;
}

.about .about-top-content .word {
    display: block;
    font-size: 30px;
    margin: 0 10px;
}

.about .about-top-content .text2 {
    position: absolute;
    width: 300px;
    height: 160px;
    background: rgba(255,255,255,.3); 
    border: 1px #ccc solid;
    z-index: 9;
}

.about .about-top-content .text2 .text2-content {
    margin: 15px;
}

.about .about-top-content .text2 .text2-content p {
    font-size: 14px;
}

.about .about-top-content .text2 button {
    width: 80px;
    height: 30px;
    color: #fff;
    background-color: #000;
    border: none;
    display: block;
    margin: 10px 10px 0 0;
    cursor: pointer;
}

.about .about-top-content .text2 button:hover {
    background-color: #fff;
    color: #000;
    border: 1px #000 solid;
}


.about .about-top-content .pic {
    width: 400px;
    height: 260px;
    position: absolute;
    bottom: 0px;
    left: 200px;
    /*background: url(../img/bb3.jpg) no-repeat center;*/
}

.about .about-top-content img {
    width: 400px;
    height: 260px;
}
.about .about-top-content .student,
.about .about-top-content .faculty {
    border: 1px #07cbc9 solid;
    width: 160px;
    height: 100px;
    position: absolute;
    right: 0;
    top: 140px;
    text-align: center;
}

.about .about-top-content .faculty {
   top: 260px; 
}

.about .about-top-content .tit {
    font-size: 30px;
    font-weight: bold;
    display: block;
    margin: 10px 0 5px;
}

/*about 下半部分样式*/
.about .about-bottom {
    width: 100%;
    height: 500px; 
}

.about-item {
    float: left;
    height: 250px;
    width: 25%;
    background-color: #07cbc9;
}

.about .about-bottom .item1 {
    background: url(../img/b1.jpg) no-repeat center;
}

.about .about-bottom .item3 {
    background: url(../img/b2.jpg) no-repeat center;
}

.about .about-bottom .item6 {
    background: url(../img/b3.jpg) no-repeat center;
}

.about .about-bottom .item8 {
    background: url(../img/b4.jpg) no-repeat center;
}


.about-bottom .about-item-content {
    margin: 25px;
}

.about-bottom .about-item-content .title {
    color: #fff;
    font-size: 20px;
}

.about-bottom .about-item-content .content-1 {
    color: #fff;
    font-size: 12px;
    margin-top: 10px;
}

.about-bottom .about-item-content .content-2 {
    color: #fff;
    font-size: 10px;
    margin-top: 10px;
}

.about-bottom .about-item-content button {
    width: 80px;
    height: 30px;
    color: #fff;
    background-color: #000;
    border: none;
    display: block;
    margin: 15px auto 0 auto;
    cursor: pointer;
}

.about-bottom .about-item-content button:hover {
    background-color: #07cbc9;
    border: 1px #000 solid;
}

/*gallery样式*/
.gallery {
    width: 100%;
    height: 600px;
    background: #fff;
    position: relative;
}

.gallery .gallery-top .about {
    width: 100%;
    height: 50px;
    text-align: center;
    font-size: 40px;
    font-weight: bold; 
    margin-top: 40px;
}

.gallery .gallery-top .text1 {
    width: 400px;
    height: 80px;
    text-align: center;
    font-size: 12px;
    margin: 0 auto;
}


.gallery .gallery-bottom {
    width: 806px;
    height: 400px;
    margin: 0 auto;
}

.gallery .gallery-bottom .gallery-bottom-item {
    width: 246px;
    height: 180px;
    margin: 10px;
    float: left;
    position: relative;
}

.gallery .gallery-bottom .gallery-bottom-top {
    width: 100%;
    height: 40px;
    line-height: 40px;
    background-color: #333;
    position: absolute;
    bottom: 0;
    color: #fff;
}

.gallery .gallery-bottom .gallery-pic {
    width: 100%;
    height: 140px;
}

.gallery .gallery-bottom .gallery-pic img {
    width: 100%;
    height: 140px;
}

/*footer样式*/
.footer {
    height: 80px;
    line-height: 80px;
    text-align: center;
    background: #07cbc9;
    color: #fff;
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值