代码可以么请问

来源:2-17 自由编程

慕斯3525401

2020-11-16 13:17:13

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <link rel="stylesheet" href="css/css.css">

</head>

<body>

    <!-- Header区域 -->

    <header>

        <div class="header-top">

            <div class="logo">

                <img class="logo_img" src="images/logo.png" alt="">

            </div>

            <nav class="navigate">

                <ul>

                    <li>HOME</li>

                    <li>ABOUT</li>

                    <li>GALLERY</li>

                    <li>FACULTY</li>

                    <li>EVENTS</li>

                    <li>CONTACT</li>

                </ul>

            </nav>

         </div>

    </header>

    <!-- Banner区域 -->

    <div class="banner">

        <div class="image">

            <img src="images/banner3.jpg" alt="">

        </div>

        <div class="mask"></div>

        <div class="form">

            <form action="" method="post">

                <input class="form_info" type="text" placeholder="your Name">

                <input class="form_info" type="password" placeholder="your Password">

                <input class="form_info" type="email" placeholder="your Email">

                <textarea class="form_info" placeholder="Write Your Comment Here" rows="5" cols="50"></textarea>

                <!-- <button type="submit">SEND MESSAGE</button> -->

                <input class="form_info" type="submit" value="SEND MESSAGE">

            </form>

        </div>

    </div>

    <!-- About区域 -->

    <div class="about">

        <div class="About-top">

            <div class="about-headline">

                <h2>ABOUT</h2>

            </div>

            <div class="sep"></div>

            <div class="about-brief">

                <p>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.</p>

            </div>

        </div>

        <div class="About-bottom">

            <div class="About-bottom-left">

                <h3>A WORD<br>ABOUT US</h3>

                <div class="About-bottom-1">

                    <p>Praesent dignissim viverra est, sed bibendum ligula congue non. Sed ac nisl et felis gravida commodo? Suspendisse eget ullamcorper ipsum. Suspendisse diam amet.</p>

                    <span>EXPLORE</span>

                </div>

            </div>

            <div class="About-bottom-2">

                <img src="images/bb3.jpg" alt="">

            </div>

            <div class="About-bottom-right">

                <div class="About-bottom-3">

                    <p>70000</p>

                    <div class="sep"></div>

                    <span>students</span>

                </div>

                <div class="About-bottom-4">

                    <p>600</p>

                    <div class="sep"></div>

                    <span>Faculty</span>

                </div>

            </div>

        </div>

    </div>

    <!-- 图文混排区域 -->

    <div class="imageAndText-mix">

        <div class="image-1">

            <img src="images/b1.jpg" alt="">

        </div>

        <div class="text text-2">

            <h3>Library</h3>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>

            <p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>

            <span>EXPLORE</span>

        </div>

        <div class="image-3">

            <img src="images/b2.jpg" alt="">

        </div>

        <div class="text text-4">

            <h3>Library</h3>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>

            <p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>

            <span>EXPLORE</span>

        </div>

        <div class="text text-5">

            <h3>Library</h3>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>

            <p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>

            <span>EXPLORE</span>

        </div>

        <div class="image-6">

            <img src="images/b3.jpg" alt="">

        </div>

        <div class="text text-7">

            <h3>Library</h3>

            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>

            <p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>

            <span>EXPLORE</span>

        </div>

        <div class="image-8">

            <img src="images/b4.jpg" alt="">

        </div>

    </div>

    <!-- Gallery区域 -->

    <div class="gallery about">

        <div class="gallery-top About-top">

            <div class="gallery-headline about-headline">

                <h2>GALLERY</h2>

            </div>

            <div class="sep"></div>

            <div class="gallery-brief">

                <p>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.</p>

            </div>

        </div>

        <div class="gallery-bottom">

            <dl>

                <dt>

                    <img src="images/03-01.jpg" alt="">

                </dt>

                <dd>Science Lab</dd>

            </dl>

            <dl>

                <dt>

                    <img src="images/03-02.jpg" alt="">

                </dt>

                <dd>Indoor Stadium</dd>

            </dl>

            <dl>

                <dt>

                    <img src="images/03-03.jpg" alt="">

                </dt>

                <dd>Transportation</dd>

            </dl>

            <dl>

                <dt>

                    <img src="images/03-04.jpg" alt="">

                </dt>

                <dd>Kids Room</dd>

            </dl>

            <dl>

                <dt>

                    <img src="images/03-05.jpg" alt="">

                </dt>

                <dd>Meditation Classes</dd>

            </dl>

            <dl>

                <dt>

                    <img src="images/03-06.jpg" alt="">

                </dt>

                <dd>Kids Play Ground</dd>

            </dl>

        </div>

    </div>

    <!-- Footer区域 -->

    <footer>

        <div class="copyright">

            <p>&copy;2016 imooc.com 京ICP备13046642号</p>

        </div>

    </footer>

</body>

</html>




CSS:

* {

    padding:0;

    margin:0;

}

ul,ol{

    list-stylenone;

}


/* 分割线 */

.sep{

    width60px;

    height3px;

    background#07cbc9;

    margin:10px auto;

}


/* header区域 */

header{

    width:100%;

    height:80px;

    background-color#07cbc9;

}


header .header-top{

    margin:0 auto;

    overflowhidden;

    width:1200px;

}


header .header-top .logo{

    float:left;

    padding:16px 0;

}


header .header-top .logo .logo_img{

    displayblock;

}


header .header-top .navigate{

    float:right;

}


header .header-top .navigate ul li{

    floatleft;

    margin-right:20px;

    text-aligncenter;

    line-height80px;

    font-size16px;

    color:white;

}


/* banner区域 */

.banner{

    positionrelative;

}


.banner .image img{

    width100%;

    displayblock;

    height:600px;

}


.banner .mask{

    background:rgba(0000.5);

    height:600px;

    width:100%;

    positionabsolute;

    top:0;

}


.banner .form{

    positionabsolute;

    top:100px;

    left:50%;

    margin-left:-252px;

    width:508px;

    text-align:center;

}


.banner .form input{

    height:40px;

    margin-bottom20px;

}


.banner .form input:last-child{

    width200px;

    height:40px;

}


.banner .form .form_info{

    backgroundnone;

    width504px;

    color:#808080;

    border-color:#808080;

    border-style:solid;

}


.banner .form textarea{

    height:110px;

    margin-bottom20px;

}


/* about区域 */

.about{

    width:1200px;

    margin:0 auto;

    margin-top30px;

}


.about .About-top{

    text-aligncenter;

}


.about .About-top .about-headline{

    font-size32px;

}


.about .About-top .about-brief{

    color:gray;

    font-size14px;

}


.about .About-bottom{

    width:1200px;

    height464px;

    positionrelative;

    overflowhidden;

}


.about .About-bottom .About-bottom-left{

    float:left;

}


.about .About-bottom h3{

    font-size30px;

    margin-top33px;

}


.about .About-bottom .About-bottom-2{

    positionabsolute;

    left:50%;

    margin-left:-325px;

    margin-top30px;

}


.about .About-bottom .About-bottom-2 img{

    width:650px;

    height435px;

    displayblock;

}


.about .About-bottom .About-bottom-1{

    width:300px;

    padding:20px;

    font-size:18px;

    border:1px solid gray;

    backgroundrgba(255,255,255,0.5);

    positionabsolute;

    top:140px;

    left:0;

    z-index99;

}


.about .About-bottom .About-bottom-1 span{

    width140px;

    height40px;

    color:white;

    font-size20px;

    displayblock;

    background-colorblack;

    text-aligncenter;

    line-height40px;

    margin-top20px;

}


.about .About-bottom .About-bottom-right{

    floatright;

    width260px;


}


.about .About-bottom .About-bottom-3,.about .About-bottom .About-bottom-4{

    padding:40px 0;

    border:1px solid #07cbc9;

    text-aligncenter;

    margin-top30px;

}


.about .About-bottom .About-bottom-3 p,.about .About-bottom .About-bottom-4 p{

    font-weightbold;

    font-size28px;

}


/* 混排区域 */

.imageAndText-mix{

    width:100%;

    height:760px;

    margin-top:18px;

}


.imageAndText-mix div{

    width:25%;

    height:380px;

    floatleft;

}


.imageAndText-mix div img{

    displayblock;

    height:380px;

    width:100%;

}


.imageAndText-mix .text{

    background-color#07cbc9;

    positionrelative;

}


.imageAndText-mix .text:nth-child(2n+2)::before{

    content:'';

    width:0;

    height0;

    positionabsolute;

    border:20px solid transparent;

    border-right-color#07cbc9;

    top:170px;

    margin-top-20px;

    left:-40px;

}


.imageAndText-mix .text:nth-child(2n+5)::after{

    content:'';

    width:0;

    height0;

    positionabsolute;

    border:20px solid transparent;

    border-left-color#07cbc9;

    top:170px;

    margin-top-20px;

    right:-40px;

}


.imageAndText-mix .text h3{

    font-size24px;

    color:white;

    margin:20px 0 30px 20px;

}


.imageAndText-mix .text p{

    margin-left20px;

    margin-bottom20px;

    font-size16px;

    colorwhite;

}


.imageAndText-mix .text p:last-of-type{

    margin-bottom30px;

    font-size14x;

    color:gray;

}


.imageAndText-mix .text span{

    displayblock;

    width138px;

    height40px;

    background-colorblack;

    line-height40px;

    text-aligncenter;

    colorwhite;

    margin:0 auto;

}


/* gallery区域 */

.gallery-bottom{

    width1160px;

    height653px;

    padding0 20px;

    margin0 auto;

    overflowhidden;

}


.gallery-bottom img{

    displayblock;

    width360px;

    height240px;

}


.gallery-bottom dl{

    floatleft;

    margin-right40px;

    margin-top30px;

}


.gallery-bottom dl:nth-child(3n){

    margin-right0;

}


.gallery-bottom dl dd{

    width340px;

    height50px;

    background-color:black;

    color:white;

    line-height50px;

    padding-left:20px;

}


/* 页脚区域 */


footer .copyright{

    width100%;

    height80px;

    background-color#07cbc9;

    text-aligncenter;

    line-height80px;

    margin-top30px;

}


写回答

1回答

好帮手慕久久

2020-11-16

同学你好,三角写的不错,有个问题需要优化:三角形垂直方向没有居中显示:

http://img.mukewang.com/climg/5fb2152f094825e803100390.jpg

原因是top值设置的不合理,修改如下:

http://img.mukewang.com/climg/5fb215d2096b611a06610357.jpg

另外,font-size属性值,单位是px,如下位置写错了:

http://img.mukewang.com/climg/5fb2163509e1d8b706110165.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程