【作业】about的底部没有高度
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Career Builder</title> <link rel="stylesheet" type="text/css" href=".\css\homework.css"> </head> <body> <!-- 顶部 --> <div class="header"> <img src=".\images\logo.png" alt="logo"> <ul> <li> HOME </li> <li> ABOUT </li> <li> GALLERY </li> <li> FACULTY </li> <li> EVENTS </li> <li> CONTACT </li> </ul> </div> <!-- banner --> <div class="banner"> <img src=".\images\banner3.jpg" alt="banner"> <!-- 遮罩层 --> <div class="above"></div> <div class="text"> <input type="text" placeholder=" YOUR NAME"> <br> <input type="text" placeholder=" YOUR PHONE"> <br> <input type="text" placeholder=" YOUR EMAIL"> <input type="textarea" placeholder=" WHIRE YOUR COMMENT HERE" id="textarea"> <input type="button" value="SEND MESSAGE" id="button"> </div> </div> <!-- ABOUT --> <div class="about"> <div class="about_top"> <div class="about_top_title">ABOUT</div> <div class="line">——</div> <div class="about_top_text">Lorem Ipsum is simply dummy text of the printing and typesetting<br> industry.Lorem Ipsum is simply dummy <br>text ever since the 1500s.</div> </div> <div class="about_bottom"> <div class="about_bottom_left"> <div class="about_bottom_left_title">A WORD <br>ABOUT US</div> </div> <div class="intro"> </div> <div class="intro_content"> <div class="intro_content_text"> Preasent dignissim viverra est,sed <br> bbibendum ligula congue non.Sed ac nisl<br> et felis grvida commodo?Suspendisse<br> eget ullamcorper ipsum.Suspwndisse<br> diam amet. </div> <button id="explore">EXPLORE</button> </div> <div class="about_bottom_middle"> <img src=".\images\bb3.jpg" alt="bb3"> </div> <div class="about_bottom_right"> <div class="about_bottom_right1"> <p class="num">70000</p> <div class="line">——</div> <p class="word">Students</p> </div> <div class="about_bottom_right2"> <p class="num">600</p> <div class="line">——</div> <p class="word">Faculty</p> </div> </div> </div> <div class="bottom"> </div> </div> <div class="clear"></div> <!-- gallery --> <div class="gallery"> </div> <div class="footer"></div> </body> </html>
*{
margin: 0;
padding: 0;
font-family: "Microsoft YaHei UI";
}
.clear{
clear: both;
}
.header{
width: 100%;
height: 60px;
background-color: #07cbc9;
}
.header img{
margin-left: 50px;
float: left;
margin-top: 5px;
}
.header ul{
list-style: none;
float: right;
margin-right: 50px;
}
.header ul li{
float: left;
/*margin-left: 20px;*/
font-size: 10px;
color: #fff;
font-weight: bold;
text-align: center;
line-height: 60px;
cursor: pointer;
}
.header ul li:hover{
background-color: black;
}
.banner{
width: 100%;
height:500px;
background-color: #ddd;
}
.banner img{
width: 100%;
height: 500px;
}
.banner .above{
width: 100%;
height: 500px;
background-color: #000;
opacity: 0.5;
position: absolute;
top: 60px;
left: 0;
}
.banner .text{
width: 500px;
height: 300px;
/*background-color: #07cbc9;*/
position: absolute;
top: 150px;
left: 50%;
margin-left: -250px;
}
.banner .text input{
/*border-radius: 0;*/
width: 100%;
height: 40px;
border: 1px solid #ddd;
background-color: transparent;
margin-bottom: 20px;
color: #C7C7CD;
}
.banner .text input:hover{
border:2px solid #07cbc9;
}
.banner .text input#button:hover{
border:2px solid #07cbc9;
background-color: #07cbc9;
}
input:focus{
outline:none;
border: 1px solid #fff;
}
.banner .text input#textarea{
height: 100px;
}
.banner .text input#button{
margin-left: 175px;
width: 160px;
height: 55px;
color: #ddd;
}
.about{
width: 100%;
height: 700px;
margin: 0 auto;
/*background-color: #ddd;*/
}
.about .about_top{
width: 100%;
height: 200px;
margin-top: 50px;
background-color: #fff;
}
.about .about_top .about_top_title{
width: 182px;
font-size: 50px;
font-weight: bolder;
margin: 0 auto 20px;
}
.line{
width: 30px;
margin: -20px auto 0;
font-weight: bolder;
color: #07cbc9;
}
.about .about_top .about_top_text{
width: 100%;
margin-top: 20px;
text-align: center;
line-height: 2em;
/*font-size: 10px;*/
color: #999;
}
.about .about_bottom{
width: 100%;
height: 500px;
margin-top: 10px;
/*margin-left: 85px;*/
}
.about .about_bottom .about_bottom_left{
width: 30%;
height: 500px;
/*background-color: red;*/
float: left;
}
.about .about_bottom .about_bottom_left .about_bottom_left_title{
font-size: 35px;
margin-left: 300px;
}
.about .about_bottom .intro{
width: 450px;
height: 300px;
border: 1px solid #777;
position: absolute;
top: 920px;
left: 285px;
z-index: 3;
background-color: #fff;
opacity: 0.5;
}
.about .about_bottom .intro_content{
width: 400px;
height: 300px;
position: absolute;
top: 950px;
left: 315px;
z-index: 5;
}
.about .about_bottom .intro_content .intro_content_text{
font-size: 16px;
letter-spacing: 1px;
word-spacing: 3px;
line-height: 2em;
}
#explore{
width: 100px;
height: 50px;
margin-top: 30px;
color: #fff;
background-color: #000;
border: 2px solid #000;
}
#explore:hover{
background-color: #fff;
color: #000;
}
.about .about_bottom .about_bottom_middle{
width: 40%;
height: 500px;
/*margin-left: -150px;*/
/*margin-right: : 150px;*/
/*background-color: blue;*/
float: left;
}
.about .about_bottom .about_bottom_middle img{
width: 100%;
/*height: 100%;*/
}
.about .about_bottom .about_bottom_right{
width: 30%;
height: 500px;
/*background-color: #ddd;*/
float: right;
}
.about .about_bottom .about_bottom_right p.num{
font-size: 40px;
font-weight: bolder;
text-align: center;
line-height: 70px;
margin-bottom: 15px;
}
.about .about_bottom .about_bottom_right p.word{
font-size: 20px;
text-align: center;
line-height: 70px;
}
.about .about_bottom .about_bottom_right .about_bottom_right1{
width: 250px;
height: 150px;
border: 1px solid #07cbc9;
margin-left: 25px;
margin-bottom: 25px;
}
.about .about_bottom .about_bottom_right .about_bottom_right2{
width: 250px;
height: 150px;
border: 1px solid #07cbc9;
margin-left: 25px;
}
.about .bottom{
width: 100%;
height: 700px;
background-color: #000;
}设置了宽高但是在浏览器显示不出来,审查元素发现没有高度。
请问老师应该怎么解决还有为什么会出现这种情况呢,谢谢老师。
11
收起
正在回答
1回答
经过测试,在chrome中显示有高度, 如图,是否指这个高度:

在详细描述具体的问题和效果,以便更好帮助解决问题。加油!
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星