2-17 作业检查

2-17 作业检查

html代码:

相关代码:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Career Bulider</title>
    <link rel="stylesheet" href="Css/Css.css">
</head>

<body>
    <!-- header -->
    <header>
        <div class="header-box">
            <!-- logo -->
            <div class="logo">
                <h1>
                    <img src="./images/logo.png" alt="Career Bulider">
                </h1>
            </div>

            <!-- nav -->
            <nav>
                <ul>
                    <li><a href="#1">HOME</a></li>
                    <li><a href="#12">ABOUT</a></li>
                    <li><a href="#123">GALLERY</a></li>
                    <li><a href="#1234">FACULTY</a></li>
                    <li><a href="#1234">EVENTS</a></li>
                    <li><a href="#12345">CONTACT</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <!-- banner -->
    <div class="banner">
        <!-- banner-img -->
        <div class="banner-img">
            <img src="./images/banner3.jpg" alt="banner">
        </div>

        <!-- banner-hidder -->
        <div class="hidder"></div>

        <!-- banner-form -->
        <div class="form">
            <form action="" method="get">
                <input type="text" placeholder="your Name">
                <input type="text" placeholder="your Phone">
                <input type="email" placeholder="your Email">
                <textarea placeholder="Write Your Comment Here" cols="30" rows="10"></textarea>
                <button type="submit">SEND MESSAGE</button>
            </form>
        </div>
    </div>

    <!-- content -->
    <section class="content">
        <!-- about -->
        <div class="about">
            <div class="top-half">
                <h2>ABOUT</h2>
                <!-- 分隔线 -->
                <div class="divide"></div>
                <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 class="bottom-half">
                <div class="about-part1">
                    <h2>A WORD<br> ABOUT US</h2>
                    <div class="about-info1">
                        <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>
                        <input type="button" value="EXPLORE">
                    </div>
                </div>
                <div class="about-part2">
                    <img src="./images/bb3.jpg" alt="about-img">
                </div>
                <div class="about-part3">
                    <div class="about-info2">
                        <h3>70000</h3>
                        <div class="divide"></div>
                        <span>Students</span>
                    </div>
                    <div class="about-info2">
                        <h3>600</h3>
                        <div class="divide"></div>
                        <span>Faculty</span>
                    </div>
                </div>
            </div>
        </div>
        <!-- mixed-area -->
        <div class="mixed-area">
            <div class="mixedarea-img">
                <img src="./images/b1.jpg" alt="Library">
            </div>
            <div class="mixedarea-info">
                <h3>Library</h3>
                <p class="p-part1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
                <p class="p-part2">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>
                <input type="button" value="EXPLORE">
                <div class="left-arrow"></div>
            </div>
            <div class="mixedarea-img">
                <img src="./images/b2.jpg" alt="Computer Lab">
            </div>
            <div class="mixedarea-info">
                <h3>Computer Lab</h3>
                <p class="p-part1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
                <p class="p-part2">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>
                <input type="button" value="EXPLORE">
                <div class="left-arrow"></div>
            </div>
            <div class="mixedarea-info">
                <h3>Conference Hall</h3>
                <p class="p-part1">Lorem Ipsum is simply dummy
                    text of the printing and typesetting industry</ p>
                <p class="p-part2">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>
                <input type="button" value="EXPLORE">
                <div class="right-arrow"></div>
            </div>
            <div class="mixedarea-img">
                <img src="./images/b3.jpg" alt="Conference Hall">
            </div>
            <div class="mixedarea-info">
                <h3>Play Ground</h3>
                <p class="p-part1">Lorem Ipsum is simply dummy
                    text of the printing and typesetting industry</ p>
                <p class="p-part2">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>
                    <input type="button" value="EXPLORE">
                <div class="right-arrow"></div>
            </div>
            <div class="mixedarea-img">
                <img src="./images/b4.jpg" alt="Play Ground">
            </div>
        </div>
        <!-- GALLERY -->
        <div class="gallery">
            <div class="top-half">
                <h2>GALLERY</h2>
                <div class="divide"></div>
                <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 class="bottom-half">
                <div class="class-infor">
                    <a href="#23">
                        <img src="./images/03-01.jpg" alt="Science Lab" class="class-img">
                        <div class="class-link">
                            Science Lab
                        </div>
                    </a>
                </div>
                <div class="class-infor">
                    <a href="#234">
                        <img src="./images/03-02.jpg" alt="Indoor Stadium" class="class-img">
                        <div class="class-link">
                            Indoor Stadium
                        </div>
                    </a>
                </div>
                <div class="class-infor">
                    <a href="#235">
                        <img src="./images/03-03.jpg" alt="Transportation" class="class-img">
                        <div class="class-link">
                            Transportation
                        </div>
                    </a>
                </div>
                <div class="class-infor">
                    <a href="#236">
                        <img src="./images/03-04.jpg" alt="Kids Room" class="class-img">
                        <div class="class-link">
                            Kids Room
                        </div>
                    </a>
                </div>
                <div class="class-infor">
                    <a href="#237">
                        <img src="./images/03-05.jpg" alt="Meditation Classes" class="class-img">
                        <div class="class-link">
                            Meditation Classes
                        </div>
                    </a>
                </div>
                <div class="class-infor">
                    <a href="#238">
                        <img src="./images/03-06.jpg" alt="Kids Play Ground" class="class-img">
                        <div class="class-link">
                            Kids Play Ground
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- footer -->
    <footer>
        <p>&copy; 2016 imooc.com 京ICP备13046642</p>
    </footer>
</body>

</html>

css代码:

相关代码:

* {
    color: #333;
    margin: 0;
    padding: 0;
}

ul,
ol {
    list-style-type: none;
}

a {
    text-decoration: none;
}

/* header部分设置 */
header {
    width: 100%;
    height: 80px;
    background-color: #07cac8;
}

header .header-box {
    height: 80px;
    width: 1200px;
    margin: 0 auto;
}

header .header-box .logo {
    float: left;
    height: 48px;
    margin-top: 16px;
    margin-bottom: 16px;
}

header .header-box nav {
    float: right;
    font-size: 16px;
    height: 80px;
    line-height: 80px;
}

header .header-box nav ul li {
    float: left;
    margin-right: 20px;
}

header .header-box nav ul li:last-child {
    margin-right: 0px;
}

header .header-box nav ul li a {
    color: white;
}

/* banner部分设置 */
.banner {
    width: 100%;
    height: 600px;
    position: relative;
    overflow: hidden;
}

.banner .banner-img {
    height: 600px;
}

.banner .banner-img img {
    height: 600px;
    width: 100%;
}

.banner .hidder {
    width: 100%;
    height: 600px;
    background: rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 0;
    left: 0;
}

.banner .form {
    width: 504px;
    position: absolute;
    top: 100px;
    left: 50%;
    margin-left: -252px;
    text-align: center;
}

.banner .form form input {
    width: 500px;
    height: 36px;
}

.banner .form form textarea {
    height: 106px;
    width: 500px;
}

.banner .form form button {
    width: 200px;
    height: 40px;
}

.banner .form form input,
textarea,
button {
    color: #808080;
    background: none;
    border: #808080 solid 2px;
    margin-bottom: 15px;
}

/* content部分设置 */
.content {
    width: 100%;
    /* background-color: aquamarine; */
    /* position: relative; */
}

/* about部分设置 */
.content .about {
    /* background-color: bisque; */
    margin-top: 30px;
    overflow: hidden;
}

.content .about .divide {
    width: 60px;
    height: 3px;
    background-color: #07cbc9;
    margin: 10px auto;
}

.content .about .top-half {
    text-align: center;
    /* background-color: blueviolet; */
}

.content .about .top-half h2 {
    font-size: 32px;
}

.content .about .top-half p {
    text-align: center;
    color: gray;
    font-size: 14px;
}

.content .about .bottom-half {
    width: 1200px;
    height: 464px;
    /* background-color: thistle; */
    margin: 0 auto;
    padding-top: 30px;
    position: relative;
}

.content .about .bottom-half .about-part1 {
    float: left;
    margin-top: 30px;
    position: absolute;
}

.content .about .bottom-half .about-part1 .about-info1 {
    width: 300px;
    padding: 20px;
    font-size: 18px;
    border: 1px solid gray;
    background: rgba(255, 255, 255, 0.5);
    margin-top: 15px;
}

.content .about .bottom-half .about-part1 .about-info1 p {
    width: 300px;
    margin-bottom: 15px;
}

.content .about .bottom-half .about-part1 .about-info1 input[type="button"] {
    width: 138px;
    height: 40px;
    text-align: center;
    color: white;
    background: #000;
}

.content .about .bottom-half .about-part2 {
    width: 650px;
    height: 435px;
    float: left;
    margin-left: 267px;
    margin-top: 30px;
}

.content .about .bottom-half .about-part2 img {
    width: 650px;
    height: 435px;
}

.content .about .bottom-half .about-part3 {
    float: right;
    margin-top: 30px;
    text-align: center;
}

.content .about .bottom-half .about-part3 .about-info2 {
    width: 258px;
    margin-bottom: 30px;
    border: 1px solid #07cac8;
    padding: 40px 0px;
}

.content .about .bottom-half .about-part3 .about-info2 h3 {
    font-size: 28px;
    font-weight: bold;
}

/* 图文混合区域设置 */
.content .mixed-area {
    width: 100%;
    overflow: hidden;
    margin-top: 30px;
}

.content .mixed-area .mixedarea-img,
.mixedarea-info {
    width: 25%;
    height: 380px;
    float: left;
}

.content .mixed-area .mixedarea-img img {
    display: block;
    width: 100%;
    height: 100%;
}

.content .mixed-area .mixedarea-info {
    box-sizing: border-box;
    padding: 20px 20px;
    background: #07cbc9;
    position: relative;
}

.content .mixed-area .mixedarea-info h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 30px;
}

.content .mixed-area .mixedarea-info .p-part1 {
    font-size: 16px;
    color: white;
    margin-bottom: 20px;
}

.content .mixed-area .mixedarea-info .p-part2 {
    font-size: 14px;
    color: gray;
    margin-bottom: 30px;
}

.content .mixed-area .mixedarea-info input[type="button"] {
    width: 138px;
    height: 40px;
    background: #000;
    color: white;
    display: block;
    margin: 0 auto;
}

/* 三角形装饰设置 */

.content .mixed-area .mixedarea-info .left-arrow {
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-right-color: #07cbc9;
    position: absolute;
    top: 50%;
    margin-top: -40px;
    left: -40px;
}

.content .mixed-area .mixedarea-info .right-arrow {
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-left-color: #07cbc9;
    position: absolute;
    top: 50%;
    margin-top: -40px;
    right: -40px;
}

/* GALLERY部分设置 */

.content .gallery {
    margin-top: 30px;
    overflow: hidden;
}

.content .gallery .top-half {
    text-align: center;
}

.content .gallery .top-half h2 {
    font-size: 32px;
}

.content .gallery .top-half .divide {
    width: 60px;
    height: 3px;
    background-color: #07cbc9;
    margin: 10px auto;
}

.content .gallery .top-half p {
    text-align: center;
    color: gray;
    font-size: 14px;
}

.content .gallery .bottom-half {
    width: 1200px;
    height: 653px;
    margin: 0 auto;
    padding: 30px 20px 0;
}

.content .gallery .bottom-half .class-infor {
    width: 360px;
    height: 290px;
    float: left;
    margin-right: 40px;
    margin-bottom: 30px;
    position: relative;
}

.content .gallery .bottom-half .class-infor:nth-child(3n) {
    margin-right: 0px;
}


.content .gallery .bottom-half .class-infor img {
    width: 360px;
    height: 290px;
}

.content .gallery .bottom-half .class-infor .class-link {
    width: 360px;
    height: 50px;
    line-height: 50px;
    background-color: #000;
    color: white;
    padding-left: 20px;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
    left: 0;
}

footer {
    width: 100%;
    height: 80px;
    line-height: 80px;
    text-align: center;
    background-color: #07cbc9;
    overflow: hidden;
}


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕久久 2022-07-21 17:04:01

同学你好,写的不错,有一个小问题需要注意:

三角形总高度是40,一半是20,所以垂直居中时,margin-top的值需要调整一下:

https://img1.sycdn.imooc.com//climg/62d91668090f9c8506950326.jpg

所有三角形同理,同学调整一下。

祝学习愉快!

  • 提问者 呜蜩的呀 #1

    感谢老师提醒,我想请问一下设置的三角形高度怎么看的呢,边框粗细*2吗?我代码里面的数据是看检查调的😂😂

    2022-07-21 17:36:56
  • 好帮手慕久久 回复 提问者 呜蜩的呀 #2

    对的。由于没有width、padding属性,所以边框*2就是实际宽度(高度)。可以通过审查元素获取元素的高度信息:

    按键盘F12键,打开控制台的elements区域:

    https://img1.sycdn.imooc.com//climg/62d91f1509ab79df09740653.jpg

    将下图中的“箭头”,移入页面上的三角形:

    https://img1.sycdn.imooc.com//climg/62d91f2d09d4e47905000121.jpg

    就可以看到大小信息了:

    https://img1.sycdn.imooc.com//climg/62d91f5c095d36b008540584.jpg



    2022-07-21 17:42:28
  • 提问者 呜蜩的呀 回复 好帮手慕久久 #3

    好的,谢谢老师

    2022-07-21 20:33:53
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师