麻烦老师帮我看看有没有需要改进的?

来源:4-8 自由编程

Livesinkon

2020-11-10 20:39:30

# 具体遇到的问题

# 报错信息的截图

# 相关课程内容截图

# 尝试过的解决思路和结果

# 粘贴全部相关代码,切记添加代码注释(请勿截图)

【以下是HTML部分】

<!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/4_8css.css">

</head>


<body>


    <div class="box1">

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


        <img class="img" src="/images/素材/4_8pic.jpg" alt="">


        <div class="box2_1">


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


            <div class="box2_1_1">

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


        <div class="box2_2">

            <div class="box2_2_1">

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

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

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

            </div>

            <div class="box2_2_2">

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

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

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

            </div>

        </div>

    </div>


</body>

</html>


【以下是CSS部分】


*{

    padding:0;

    margin0;

}


.box1{

    width1201px;

    margin0 auto;

}


.box1 h1{

    font-size32px;

    text-aligncenter;

    margin-top30px;

}


.line{

    width60px;

    height3px;

    background-color#07cbc8;

    margin:10px auto;

}


.box1 .p1{

    width450px;

    text-aligncenter;

    colorgray;

    font-size14px;

    margin:0 auto;

}


.box2{

    positionrelative;

    width1201px;

    height:464px;

    margin0 auto;

    }


.box2 .img{

    positionabsolute;

    float:left;

    width650px;

    height435px;

    displayblock;

    top30px;

    left:270px;

}

    

.box2 .box2_1{

    float:left;

    margin-top30px;

}


.box2 .box2_1 h2{

    font-size28px;

    font-weightbold;

}


.box2 .box2_1 h2 span{

    font-size28px;

    font-weightbold;

    display:block;

}


.box2 .box2_1 .box2_1_1{

    positionabsolute;

    width340px;

    margin-top30px;

    border1px solid gray;

    background-colorrgba(255,255,255,0.5);

}


.box2 .box2_1 .box2_1_1 .p2{

    width300px;

    font-size18px;

    padding20px;

}


.box2 .box2_1 .box2_1_1 .p3{

    width140px;

    height40px;

    margin-top20px;

    margin-left:20px;

    margin-bottom:20px;

    color:white;

    background-colorblack;

    text-aligncenter;

    line-height40px;

}


.box2 .box2_2{

    floatright;

    margin-top30px;

    width260px;

    text-aligncenter;

}


.box2 .box2_2 .box2_2_1{

    padding-top40px;

    padding-bottom40px;

    margin-bottom30px;

    border1px solid #07cbc8;

}


.box2 .box2_2 .box2_2_1 .p4{

    font-size28px;

    font-weightbold;

}


.box2 .box2_2 .box2_2_1 .p5{

    font-size20px;

}


.box2 .box2_2 .box2_2_2{

    padding-top40px;

    padding-bottom40px;

    border1px solid #07cbc8;


}


.box2 .box2_2 .box2_2_2 .p6{

    font-size28px;

    font-weightbold;

}


.box2 .box2_2 .box2_2_2 .p7{

    font-size20px;

}


写回答

1回答

好帮手慕码

2020-11-11

同学你好,代码实现的很好。不需要优化了,祝学习愉快~

1

0 学习 · 15276 问题

查看课程