老师,看下代码正不正确

来源:4-4 自由编程

慕用6234762

2021-01-10 20:13:22

<!DOCTYPE html>


<html lang="en">



*{

    margin0;

    padding0;

}

ul{

    list-stylenone;

}

a{

    text-decorationnone;

}

header{

    height:80px ;

    background-color#07cbc9;

    

}

header .header{

    margin0 auto;

    width1200px;

    height80px;

}

header .header .logo{

    margin-top16px;

    floatleft;

}

header .header nav{

    floatright;

}

header .header nav ul li{

    floatleft;

    font-size16px;

    displayinline-block;

    colorwhite;

    line-height80px;

    margin-left20px;

}



<head>


    <meta charset="UTF-8">


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


    <meta name="Keywords" content="">


    <meta name="Description" content="">


    <title>Document</title>

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


</head>




<body>


    <!-- Header区域 -->


    <header>

        <div class="header">

            <div class="logo">

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

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


        <div class="banner-images">


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


        </div>


        <div class="banner-cover">


            banner遮罩层


        </div>


        <div class="banner-form">


            <form action="" method="POST">


                <input type="text" placeholder="your Name"><br>


                <input type="text" placeholder="your Phone"><br>


                <input type="email" placeholder="you Email"><br>


                <textarea cols="50" rows="10" placeholder="Write your Comment Here"></textarea><br>


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


            </form>


        </div>


    </div>




    <!-- about区域 -->


    <div class="about">


        <!-- 标题和介绍 -->


        <div class="about-title">


            <h2>ABOUT</h2>


            <p>分割线</p>


            <p>Lorem Ipsum is simply dummy text of the printing and typesetting Ipsum has been the industry's standard

                dummy ever since the 1500s.</p>


        </div>




        <!-- 详细内容介绍 -->


        <div class="about-content">


            <div>


                <h3>A WORD ABOUT US</h3>


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


                <p>EXPLORE</p>


            </div>


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


            <div>


                <div>


                    <p>70000</p>


                    <p>分割线</p>


                    <p>Students</p>


                </div>


                <div>


                    <p>600</p>


                    <p>分割线</p>


                    <p>Faculty</p>


                </div>


            </div>


        </div>


    </div>




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


    <div class="images-and-text">


        <div class="images1">


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


        </div>


        <div class="text2">


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


            <p>EXPLORE</p>


        </div>


        <div class="images3">


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


        </div>


        <div class="text4">


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


            <p>EXPLORE</p>


        </div>


        <div class="text5">


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


            <p>EXPLORE</p>


        </div>


        <div class="images6">


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


        </div>


        <div class="text7">


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


            <p>EXPLORE</p>


        </div>


        <div class="images8">


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


        </div>


    </div>




    <!-- gallery区域 -->


    <div class="gallery">


        <!-- 标题和介绍 -->


        <div class="gallery-title">


            <h2>GALLERY</h2>


            <p>分割线</p>


            <p>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 calss="gallery-content">


            <dl>


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


                <dd>Science Lab</dd>


            </dl>


            <dl>


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


                <dd>Indoor Stadium</dd>


            </dl>


            <dl>


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


                <dd>Transportation</dd>


            </dl>


            <dl>


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


                <dd>Kids Room</dd>


            </dl>


            <dl>


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


                <dd>Meditation Classes</dd>


            </dl>


            <dl>


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


                <dd>Kids Play Ground</dd>


            </dl>


        </div>


    </div>




    <!-- footer区域 -->


    <footer>


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


    </footer>


</body>




</html>


写回答

1回答

好帮手慕慕子

2021-01-11

同学你好,代码实现是正确的,建议优化:导航项设置浮动后,就可以实现在一排显示了,这样就不需要再给导航项设置display:inline-block;属性了,可以去掉这句代码,简化代码书写。

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

另外,同学将css代码放在html中粘贴过来时,可以将css代码放在style标签中哦

祝学习愉快~

0

0 学习 · 15276 问题

查看课程