麻烦老师检查一下给些建议,发现很多小细节很多问题,还有右边盒子里的内容不懂居中

来源:4-8 自由编程

qq_慕侠5425943

2021-03-17 16:55:25

相关代码:

<!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="max">
<div class="top">
<!-- 主标题 -->
<h1>ABOUT</h1>
<!-- 顶部横杠 -->
<div class="A"></div>
<!-- 顶部文字 -->
<div class="topw">
<p>Lorem lpsum is slmply dummy text of the printing and typesetting</p >
<p>industry.Lorem Ipsum has been the industey's standard dummy</p>
<p>text ever since the 1500s.</p>
</div>
</div>
<!-- 中间大盒子 -->
<div class="ecenter">
<!-- 左边部分 -->
<div class="left">
<!-- 左边大字 -->
<div class="leftd">
<h2>A WORD</h2>
<h2>ABOUT US</h2>
</div>
<!-- 左边下半部分 -->
<div class="ll">
<!-- 左边中间小文字 -->
<div class="lm">
<p>Prasesne dingnissim viverra est, sed</p>
<p>bibendum ligula congue non. Sed</p>
<p>ac nisl et felis gravida commodo?</p>
<p>Suspendisse eget ullamcorper</p>
<p>ipsum. Suspendisse diam amet</p>
</div>
<!-- 左边最下面方块 -->
<div class="llb">
<p>EXPLORE</p>
</div>
</div>
</div>

<!-- 中间版心图片 -->
<div class="center">
<img src="images/bb3.jpg">
</div>

<!-- 右边部分 -->
<div class="right">
<!-- 右边上面 -->
<div class="ra">
<p3>70000</p3>
<div class="B"></div>
<p>Students</p>
</div>
<!-- 右边下面 -->
<div class="rl">
<p4>600</p4>
<div class="C"></div>
<p>Faculty</p>
</div>
</div>
</div>
</div>
</body>
</html>

*{

    margin0;

    padding0;

}

/* 大盒子 */

.max{

    width100%;

    padding-top30px;

    

}

.max .top .A{

    width60px;

    height3px;

    background-color#07cbc9;

    margin0 auto;

}

.max .top{  

    text-aligncenter;

    

}

/* 中间大盒子 */

.max .ecenter{

    width1201px;

    height464px;

    margin0 auto;

    positionrelative;

}

/* 左边盒子 */

.max .ecenter .left{

    width251px;

    height100%;

    background:rgba(255,255,255,0.5);

    floatleft;

}

.max .ecenter .left .leftd{

    margin-top30px;

}

.max .ecenter .left .ll{

    positionabsolute;

    width300px;

    padding20px;

    border1px solid gray;

}


.max .ecenter .left .ll .llb{

    width140px;

    height40px;

    background-colorblack;

    margin-top30px;

   

}

.max .ecenter .left .ll .llb p{

    colorcornsilk;

    text-aligncenter;

    line-height40px;


}

.max .ecenter .center img{

    width650px;

    height435px;

    displayblock;

    floatleft;

    margin-top30px;

}

/* 右边盒子 */

.max .ecenter .right{

    width260px;

    height464px;


    floatleft;

}

.max .ecenter .right .ra{

    width260px;

    height130px;

    bordercyan 1px solid;

    text-aligncenter;

    margin-top30px;

    

}

.max .ecenter .right .ra p3{

    font-size28px;

    font-weightbold;

    

}

.max .ecenter .right .ra .B{

    width60px;

    height3px;

    background-color#07cbc9;

    margin10px auto;

    

}

.max .ecenter .right .rl{

    width260px;

    height130px;

    bordercyan 1px solid;

    text-aligncenter;

    margin-top30px;

}

.max .ecenter .right .rl .C{

    width60px;

    height3px;

    background-color#07cbc9;

    margin10px auto;

}

.max .ecenter .right .rl p4{

    font-size28px;

    font-weightbold;

    

}


写回答

2回答

好帮手慕夭夭

2021-03-18

同学你好,给文本框的大盒子.ll设置就行哦。

http://img.mukewang.com/climg/6052b39d09e143ce03430188.jpg

祝学习愉快~

1

好帮手慕夭夭

2021-03-17

同学你好,代码的问题与修改如下:

1、文本框没有设置白色半透明背景遮罩

http://img.mukewang.com/climg/6051c5a109891ed104510248.jpg

这个任务提示中是有给出示例代码的,参考如下:

http://img.mukewang.com/climg/6051c5c209f86d3305750119.jpg

2、图片与右侧内容没有设置间距

http://img.mukewang.com/climg/6051c6340971d04213490432.jpg

这里建议让右侧内容再往右移动一点,显示在父容器的最右侧,参考如下:

http://img.mukewang.com/climg/6051c677092f207002910124.jpg

3、两个蓝色盒子超出父容器。

http://img.mukewang.com/climg/6051c68809444e3f03460362.jpg

一个元素的实际宽高是包含边框和内间距的,这里蓝色盒子设置了边框,所以实际宽度大于父容器宽度,建议如下调整:

http://img.mukewang.com/climg/6051c73d0997b6a806120283.jpg

注释的去掉

http://img.mukewang.com/climg/6051c746094392a204030274.jpg

4、蓝色盒子中的内容想要垂直居中,可以去掉高度,使用padding实现。如下:


http://img.mukewang.com/climg/6051c7a1098b214b04940326.jpg

祝学习愉快~



0
hq_慕侠5425943
hp>请问老师一下,遮罩background:rgba(255,255,255,0.5);属性透明度加在哪里呢?



h021-03-17
共1条回复

0 学习 · 15276 问题

查看课程