不知道为什么三角形显示不出来

来源:2-17 自由编程

Nasiba

2020-12-18 21:29:03


<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

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

    <title>Career Bulider</title>

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

</head>

<body>

    <!-- heade区域 -->

    <header>

        <div class="hd">

            <div class="logo">

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

            </div>

            <nav>

                <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">

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

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

        <form>

                <input type="text" placeholder="your name">

                <input type="text" placeholder="your phone">

                <input type="email" placeholder="your email">

                <textarea cols="40" rows="5" placeholder="Write Your Comment Here"></textarea><br>

                <input type="submit" value="send message">

        </form>

    </div>


   <!-- about区域 -->

   <div class="section">

        <div class="top">

            <h1>ABOUT</h1>

        <div class="line"></div>

        <p class="p1">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

        </div>

        <div class="m1">

            <div class="leftbox">

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

                <div class="left-text">

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

                    <p class="p3">EXPLORE</p>

                </div>

            </div>

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

            <div class="right">

                <div class="right-top">

                    <p class="p4">70000</p>

                    <div class="line1"></div>

                    <p class="p5">Students</p>

                </div>

                <div class="right-bt"> 

                    <p class="p6">600</p>

                    <div class="line2"></div>

                    <p class="p7">Faculty</p>

                </div>   

            </div>                                     

        </div>

    </div>


<main>

    <div class="img">

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

    </div>


    <div class="text left">

        <h3>Library</h3>

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

        <p class="p2">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>EXLORE</span>    

    </div>


    <div class="img">

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

    </div>


    <div class="text left">

        <h3>Library</h3>

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

        <p class="p2">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>EXLORE</span>

    </div>


    <div class="text right">

        <h3>Library</h3>

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

        <p class="p2">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>EXLORE</span>

    </div>


    <div class="img">

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

    </div>


    <div class="text right">

        <h3>Library</h3>

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

        <p class="p2">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>EXLORE</span>

    </div>


    <div class="img">

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

    </div>

</main>


    <!-- gallery区域 -->

<div class="gallery">

     <div class="upper">

        <h3>Gallery</h3>

        <div class="line"></div>

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

        </p>

    </div>

    <!-- 下部分是gallery详细信息区 -->

    <div class="lower">

        <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>


    <!-- fotter区域 -->

    <footer>

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

    </footer>

</body>



*{

    margin0;

    padding0;

}

ul

,li{

    list-stylenone;

}

a{

    text-decorationnone;

}


/* header */

header{

    width100%;

    height80px;

    background-color#07cbc9;

}


header .hd{

    width1200px;

    height80px;

    margin0 auto;

}


header .hd .logo{

    floatleft;

    height48px;

    margin-top16px;

    margin-bottom16px;

}


header .hd nav{

    floatright;

}


header .hd nav ul li{

    floatleft;

    margin-left20px;

    font-size16px;

    line-height80px;

    color#ffffff;

    text-aligncenter;

}


.banner{

    positionrelative;

    width100%;

    height600px;

}


.banner .banner-img{

    width100%;

    height600px;

}


.banner .mask{

    positionabsolute;

    width100%;

    height600px;

    top0;

    left0;

    backgroundrgba(0000.5);

}


.banner form{

    positionabsolute;

    left50%;

    width504px;

    margin-left-252px;

    text-aligncenter;

    top100px;

}



.banner form input{

    border1px solid #808080;

    margin-top20px;

    color#808080;

    width502px;

    height40px;  

    backgroundnone;  

}


.banner form input:last-child{

    width200px;

    height40px;

}


.banner form textarea{

    width502px;

    height110px;

    backgroundnone;  

    color#808080;

    margin-top20px;

}


.section{

    width1201px;

    height1201px;

    margin0 auto;

}


.section .top{

    font-size32px;

    text-aligncenter;

}


.section .line{

    width60px;

    height3px;

    background#07cbc9;

    margin10px auto;

}


.section .p1{

    text-aligncenter;

    colorgray;

    font-size14px;

}


.section .m1{

    width1201px;

    height464px;

    positionrelative;

    overflowhidden;

}


.section .m1 .leftbox {

    floatleft;

}


.section .m1 .leftbox h2{

    margin-top50px;

}


.section .m1 img{

    width650px;

    height435px;

    positionabsolute;

    left50%;

    margin-left-325px;

    z-index-1;

    margin-top30px;

}



.section .m1 .leftbox .left-text{

    floatleft;

    width340px;

    border1px solid gray;

    positionabsolute;

    margin-top30px;

    backgroundrgba(2552552550.5);

    padding20px;

    

}


.section .m1 .leftbox .left-text .p2{

    font-size18px;

    width300px;

}


.section .m1 .leftbox .left-text .p3{

    width140px;

    height40px;

    margin-top30px;

    color:white;

    background-colorblack;

    text-aligncenter;

    line-height40px;

}


.section .m1 .right{

    floatright;

}


.section .m1 .right .right-top{

    width260px;

    padding40px 0;

    border1px solid #07cbc9;

    margin-top30px;

    margin-bottom30px;

    margin-top30px;

}


.section .m1 .right .right-top .p4{

    font-size28px;

    font-weightbold;

    text-aligncenter;

}


.section .m1 .right .right-top .line1{

    width60px;

    height5px;

    background#07cbc9;

    margin10px auto;

}


.section .m1 .right .right-top .p5{

    font-size20px;

    font-weightnormal;

    text-aligncenter;

}


.section .m1 .right .right-bt{

    width260px;

    padding-top40px;

    padding-bottom40px;

    border1px solid #07cbc9;

    margin-top30px;

}


.section .m1 .right .right-bt .p6{

    font-size28px;

    font-weightbold;

    text-aligncenter;

}


.section .m1 .right .right-bt .line2{

    width60px;

    height5px;

    background#07cbc9;

    margin10px auto;

}


.section .m1 .right .right-bt .p7{

    font-size20px;

    font-weightnormal;

    text-aligncenter;

}


main{

    overflowhidden;

    background#07cbc9;

}


main .img {

    height380px;

    floatleft;

    width25%;

    overflowhidden;

}


main .text{

    height380px;

    width25%;

    floatleft;

}


main .text ::before{

    content"";

    displayblock;

    width:0;

    height0;

    border30px solid transparent;

    position:absolute;

    top:50%;

}


main .left::before{

    border-left-color#07cbc9;

    right-40px;

}


main .right::before{

    border-right-color#07cbc9;

    left-40px;

}


main .text h3 {

    margin-top20px;

    margin20px 20px 0 20px;

    font-size24px;

    color#ffffff;

}


main .text .p1 {

    margin-top30px;

    margin20px 20px 0 20px;

    font-size16px;

    color#ffffff;

}


main .text .p2 {

    margin-top20px;

    margin20px 20px 0 20px;

    font-size14px;

    colorgray;

}


main .text span {

    margin30px auto;

    displayblock;

    width138px;

    height40px;

    backgroundblack;

    colorwhite;

    text-aligncenter;

    line-height40px;

}


.gallery .upper{

    font-size32px;

    text-aligncenter;

}


.gallery .line{

    width60px;

    height3px;

    background#07cbc9;

    margin10px auto;

}


.gallery .p1{

    text-aligncenter;

    colorgray;

    font-size14px;

}


.gallery .lower{

    width1200px;

    height653px;

    margin0 auto;

}


.gallery .lower dl{

    floatleft;

    margin30px 20px 0 20px;

}


.gallery .lower dl img {

    width360px;

    height240px;

    displayblock;

}


.gallery .lower dl dd {

    width360px;

    height50px;

    backgroundblack;

    line-height50px;

    colorwhite;

    text-indent20px;

}


footer{

    width100%;

    height80px;

    background#07cbc9;

}


footer p{

    text-aligncenter;

    line-height80px;

}


在这里输入代码,可通过选择【代码语言】突出显示

写回答

1回答

好帮手慕言

2020-12-19

同学你好,代码中存在以下问题:

1、类名与伪元素之间是没有空格的,如下:

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

2、元素的位置不对,建议:给类名为text 的元素设置相对定位,让小三角相对于.text元素定位,如下:

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

3、第一行的小三角朝向和位置不对,要修改一下,例如:

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

4、图片的宽度需要与其父级保持一致,如下:

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

​5、第二排的小三角位置和朝向需要修改一下,例如:

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

祝学习愉快~

0

0 学习 · 15276 问题

查看课程