about区的一些问题
*{ margin:0; padding:0; font-family:"Microsoft YaHei UI"; } .head{ width: 100%; height:100px; background-color:#07cbc9; position:fixed; z-index: 4; } .head img{ margin-left: 100px; padding-top:20px; } .head .nav{ float:right; } .head .nav ul{ padding-right: 100px; } .head .nav ul li { width: 100px; height: 100px; line-height: 100px; display: inline-block; font-weight: bolder; color: white; font-size: 20px; text-align: center; } .nav li:hover{ background-color: #000000; color: #ffffff; } .banner{ width:100%; } .banner img{ width:100%; height:800px; } .banner .veil{ position:absolute; top:100px; left:0px; background-color: #000; width:100%; height:700px; opacity:0.5; } .banner .information{ position:absolute; z-index: 2; width:504px; height:300px; top:400px; left:50%; margin-left: -250px; margin-top:-150px; } .banner .information input,textarea{ background-color: transparent; display: block; border: 2px solid white; font-family: Microsoft YaHei UI; width: 500px; height: 40px; margin-top:30px; } .banner .information textarea{ height:100px; overflow: hidden; } .banner .information button{ background-color: transparent; width:150px; height:40px; border: 2px solid white; font-family: Microsoft YaHei UI; margin-left:170px; margin-top:30px; color: white; line-height: 40px; } .banner .information input:hover{ border:2px solid #07cbc9; } .banner .information textarea:hover{ border:2px solid #07cbc9; } .banner .information button:hover{ background-color: #07cbc9; border-color: #07cbc9; cursor: pointer; } .about .title{ font-size:30px; color:#000; width: 100%; height:80px; line-height: 80px; text-align:center; font-weight: bolder; } .about hr{ border:0; background-color: #07cbc9; height:2px; width: 30px; } .about .about-top{ font-size: 15px; color:grey; width:100%; text-align: center; height: 80px; padding-top:10px; } .about .about-middle{ width:800px; padding:0 200px 0 200px; margin:0 350px; height: 450px; } .about .about-middle img{ width: 100%; height: 450px; } .about .about-middle .left{ width:200px; height:150px; color:#000; font-size:30px; text-align: center; position:relative; float: left; margin-top:-450px; left:-200px; } .about .about-middle .right{ width: 200px; height:400px; color:#000; font-size:30px; line-height: 50px; text-align:center; position:relative; float:right; margin-top:-450px; right:-200px; } .about .about-middle .right span{ font-size: 20px; } .about .about-middle .right .top{ width:200px; height:130px; border: #07cbc9 solid 2px; margin-left:40px; padding-top:15px; } .about .about-middle .right .bottom{ width:200px; height:130px; border: #07cbc9 solid 2px; margin-top: 50px; margin-left:40px; padding-top:15px; } .about .about-middle .left-bottom{ width:300px; height:250px; opacity: 0.5; z-index:2 ; position: absolute; margin-top: -300px; margin-left:-200px; border:solid grey 1px; color:#000; font-size: 17px; background-color:white; } .about .about-middle .left-bottom p{ width:250px; height: 130px; margin:30px 30px; z-index: 3; position: absolute; } .about .about-middle button{ width:120px; height:50px; margin-top:-120px; margin-left:-170px; cursor: pointer; background-color: #000; color: white; border:0px; font-weight: bold; z-index: 3; position: absolute; } .about .about-middle button:hover{ background-color:white; color: black; border:3px solid #000; font-weight: bold; z-index: 3; } .about .blank{ width:100%; height:100px; border: 1px solid black; } .about .about-bottom .div1,.div2,.div3,.div4,.div5,.div6,.div7,.div8{ width:25%; height:300px; }
老师这是我css部分的代码,
<!DOCTYPE html>
<html>
<head>
<title>网页布局</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="exercise.css">
</head>
<body>
<!--顶部-->
<div class="head">
<div class="logo"></div>
<img src="picture/images/logo.png">
<div class="nav">
<ul>
<a href=""><li>home</li></a>
<a href=""><li>about</li></a>
<a href=""><li>gallery</li></a>
<a href=""><li>faculty</li></a>
<a href=""><li>events</li></a>
<a href=""><li>contact</li></a>
</ul>
</div>
</div>
<!--banner区-->
<div class="banner">
<img src="picture/images/banner3.jpg">
<div class="veil"></div>
<div class="information">
<form>
<input type="text" name="uername" maxlength="6" placeholder="your name" style-color="#fff">
<input type="text" name="userphone" maxlength="10" placeholder="your phone">
<input type="text" name="useremail" maxlength="10" placeholder="your email">
<textarea name="area" placeholder="Write Your Comment Here"></textarea>
<button>SEND MESSAGE</button>
</form>
</div>
</div>
<!--about区-->
<div class="about">
<div class="title">ABOUT</div>
<hr>
<div class="about-top">Lorem Ipsum is simply dummy text of the printing and typeseting <br>industry.Lorem Ipsum has been the industry's standard dummy <br>text ever since the 1500s.
</div>
<div class="about-middle">
<div><img src="picture/images/bb3.jpg"></div>
<div class="left">A WORD<br> ABOUT US</div>
<div class="right">
<div class="top">70000<hr><span>Students</span></div>
<div class="bottom">600<hr><span>Faculty</span></div>
</div>
<div class="left-bottom">
<p class="word"> Praesent dignissim viverra est,sed bibendum ligula congue non.Sed ac nislet felis gravida commodo?Suspendisse edgt ullamcorper ipsum.Suspendisse diam amet.</p>
</div>
<button>EXPLORE</button>
<div class="blank"></div>
<div class="about-bottom">
<div class="div1"><img src="picture/images/b1.jpg"></div>
<div class="div2">
<div class="word2">
<h3>Library</h3>
<p class="p1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="p2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallery of type and scrambled it to make a type specimen book.</p>
</div>
<button>EXPLORE</button>
</div>
<div class="div3"><img src="picture/images/b2.jpg"></div>
<div class="div4">
<div class="word4">
<h3>Computer Lab</h3>
<p class="p1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="p2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallery of type and scrambled it to make a type specimen book.</p>
</div>
<button>EXPLORE</button>
</div>
<div class="div5">
<div class="word5">
<h3>Conference Hall</h3>
<p class="p1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="p2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallery of type and scrambled it to make a type specimen book.</p>
</div>
<button>EXPLORE</button>
</div>
<div class="div6"><img src="picture/images/b3.jpg"></div>
<div class="div7">
<div class="word7">
<h3>Play Ground</h3>
<p class="p1">Lorem Ipsum is simply dummy text of the printing and typesetting industry</p>
<p class="p2">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallery of type and scrambled it to make a type specimen book.</p>
</div>
<button>EXPLORE</button>
</div>
<div class="div8"><img src="picture/images/b4.jpg"></div>
</div>
</div>
</div>
</body>
</html>
这是我HTML的代码, 请问为什么在about区,我写下面那部分时,我设置了.about .about-bottom 宽度为100%,但网页里面它不是占满了整个屏幕宽度的100%,而是占满了上面about .about-middle 的100%,请问我需要怎么修改。
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36713 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星