麻烦老师检查一下,还有什么地方可以优化呢?

来源:4-11 自由编程

qq_慕侠5425943

2021-03-19 14:22:42

相关代码:

<!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>Document</title>
<link rel="stylesheet" href="自由编程.css">
</head>
<body>

<div class="top">
<h1>GALLERY</h1>
<div class="line"></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="max">
<div class="upper">
<div class="picbox">
<img src="images/03-01.jpg" alt="">
<div class="details"><p>Science Lab</p></div>
</div>

<div class="picbox">
<img src="images/03-02.jpg" alt="">
<div class="details"><p>Indoor Stadium</p></div>
</div>

<div class="picbox">
<img src="images/03-03.jpg" alt="">
<div class="details"><p>Transportion</p></div>
</div>
</div>

<div class="lower">
<div class="picbox">
<img src="images/03-04.jpg" alt="">
<div class="details"><p>Kids Room</p></div>
</div>

<div class="picbox">
<img src="images/03-05.jpg" alt="">
<div class="details"><p>Meditation Classes</p></div>
</div>

<div class="picbox">
<img src="images/03-06.jpg" alt="">
<div class="details"><p>Kids Play Ground</p></div>
</div>
</div>
</div>
</body>
</html

*{


    margin0;


    padding0;


}


/* 大盒子 */

.top h1{

    text-aligncenter;

}

.top .line{

    width60px;

    height3px;

    background-color#07cbc9;

    margin0 auto;

}

.top p{

    text-aligncenter;

}


.max{

    width1200px;

    height653px;

   

    margin0 auto;

}

.max .upper{

   

    width1200px;

    height290px;

}

.max .lower{

  

    width1200px;

    height290px;

    margin-top30px;

}


.max .picbox{

    width400px;

    height290px;

    floatleft;


    

}

.max .picbox img{

    displayblock;

    width360px;

    height240px;

    padding-left20px;

}

.max .picbox .details{

    background-colorblack;

    width360px;

    height50px;

    margin-left20px;

}

.max .picbox .details p{

    colorlavender;

    padding-top10px;

    padding-left10px;

}


写回答

1回答

好帮手慕星星

2021-03-19

同学你好,代码布局是可以的,样式上还可以优化:

图片下方的文字没有垂直居中显示,左侧间距也不是20px

http://img.mukewang.com/climg/605457e7099b5ba004060088.jpg

垂直居中建议使用行高来实现,参考

http://img.mukewang.com/climg/605458fd09cef80c04010205.jpg

祝学习愉快!

0

0 学习 · 15276 问题

查看课程