六张图片怎么分开啊

来源:2-10 作业题

Ting111

2019-05-13 20:37:35

<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<style type="text/css">
		*{padding: 0;margin: 0;}
		body{font-family: Microsoft YaHei UI;}
	/*head*/
	.head{height: 80px;width: 100%;background-color: #07cbc9;}
 	.head img{float: left;margin-top: 16px}
 	.head ul{float: right;margin-top:20px; }
 	.head ul li{float: left;padding: 10px;}
 	a{text-decoration: none;color: white;font-weight: bold;}
 	
 	/*banner*/
 	.banner{width: 100%;height: 500px;position: relative;}
 	.picbanner{margin: 0 auto;}
 	.picbanner img{width: 100%;height: 500px;}
 	
 	.inp{position: absolute;top: 77px;margin-left: 50%;left: -185px;text-align: center;}
 	.input1,textarea{width: 505px;border: 2px solid grey;margin-bottom: 15px;background-color: black;opacity: 0.5;text-transform: capitalize; color: white;font-family: Microsoft YaHei UI;}
 	.input1{height: 39px;}
 	textarea{height: 115px;}
 	button{width: 123px;height:39px;text-transform:uppercase;border: 2px solid grey;background-color: black;opacity: 0.6;color: white; }
 	/*content*/
 	.content{}
 	.about{font-size: 40px;font-weight: bold;text-align: center;padding: 10px;}
 	.Lorem{color: grey;text-align: center;}
 	.praesent{text-align: left;width: 370px;height: 246px;border: 1px solid grey;padding: 30px;background-color: white;opacity: 0.5;font-weight: bold;box-sizing: border-box;}
 	.praesent button a:hover{background: transparent;border: 1px solid black;}
 	.none{width:40px;height: 3px;background-color: lightblue;margin: 0 auto;}
 	.content button{background-color: black;color: white;width: 102px;height: 43px;margin-top: 30px}
 	.aword{font-size: 40px;}
 	.midmiddle img{height: 380px;width: 568px;}
 	.midleft{float: left;margin-top: 30px;}
 	.midmiddle{float: left;margin-top: 30px;margin-left: -120px;}
 	.midright{float: left;margin-top:30px;text-align: center;margin-left: 25px}
 	.student,.faculty{height: 144px;width: 238px;border: 1px solid lightblue;margin-bottom: 30px;}
 	.nonest{width:40px;height: 3px;background-color: lightblue;margin: 0 auto;}
 	.nonest,.num,.nam{margin-top: 20px;}
 	.num{font-weight: bold;font-size: 20px;}
 	.midtop{overflow: hidden;}
 	.tbor{width:1100px;height: 450px;margin:0 auto;}
 	/*图文*/
 	.pic1{width: 25%height:150px; background-color: lightblue;float: left;}
	</style>
</head>
<body>
<div class="head">
	<img src="images\logo.png">
	<ul style type="none">
		<li><a href="#">home</a></li>
		<li><a href="#">about</a></li>
		<li><a href="#">gallery</a></li>
		<li><a href="#">faculty</a></li>
		<li><a href="#">events</a></li>
		<li><a href="#">contact</a></li>
	</ul>
     <div class="clear"></div>
</div>
<!--head end-->
<div class="banner">
	<div class="picbanner"><img src="images\banner.jpg">
	</div>
		<div class="inp">
			<input type="text" name="name" placeholder="your name" class="input1"><br>
			<input type="text" name="phone" placeholder="your phone" class="input1"><br>
			<input type="text" name="nnnn" placeholder="your email" class="input1"><br>
			<textarea rows="8" cols="50" placeholder="write your comment here"></textarea><br>
			<button><a href="#">send message</a></button>
		</div>
	
</div>
<!--banner end-->
<div class="content">
	<div class="about">ABOUT</div>
	<div class="none"></div>
		<DIV class="Lorem ">loremloremloremloremloremloremloremloremloremloremlorem<br>loremloremloremloremloremloremloremloremloremloreml<br>oremloremloremloremloremloremloremlorem</DIV>
		    
		     <div class="tbor">
		        <div class="midleft">
		        	<div class="aword">A WORD<br> ABOUT US</div>
				    <div class="praesent">praesentpraesentpraesentpraesent<br>praesentpraesentpraesentprae<br>sentpraesentpraesentpraesentpraesent<br>praesentpraesentpraesent
				     <button><a href="#">EXPLORE</a></button></div>
				   
			    </div>
			    <div class="midmiddle"><img src="images\bb3.jpg"></div>
				<div class="midright">
					<div class="student">
						<div class="num">70000</div>
						<div class="nonest"></div>
						<div class="nam">Student</div>
					</div>
					<div class="faculty">
						<div class="num">600</div>
						<div class="nonest"></div>
						<div class="nam">Faculty</div>
					</div>
					
				</div>
			</div>
			<div class="picwor">
				
					<div class="pic1"><img src="images\b1.jpg"></div>
					<div class="pic1"><h1>Library</h1>
					     <h3>lorem ipsumis simply dummy text of the printing and typesetting industry</h3>
					     <p>lorem has been the lorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been the</p>
					 </div>
				
				
					<div class="pic1"><img src="images\b2.jpg"></div>
					<div class="pic1" ><h1>computer lab</h1>
					     <h3>lorem ipsumis simply dummy text of the printing and typesetting industry</h3>
					     <p>lorem has been the lorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been the</p>
					 </div>
				
				<br>
				
					<div class="pic1"><h1>conference hall</h1>
					     <h3>lorem ipsumis simply dummy text of the printing and typesetting industry</h3>
					     <p>lorem has been the lorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been the</p>
					 </div>
					<div class="pic1"><img src="images\b3.jpg"></div>
				

					<div class="pic1"><h1>play ground</h1>
					     <h3>lorem ipsumis simply dummy text of the printing and typesetting industry</h3>
					     <p>lorem has been the lorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been thelorem has been the</p>
					 </div>
					<div class="pic1"><img src="images\b4.jpg"></div>
				
			</div>
			<div class="clear"></div>
			

	<div class="gallery">GALLERY</div>
		<div></div>	
</div>
<!--content end -->
<div class="foot">
	
</div>
<!--foot end-->
</body>
</html>


写回答

4回答

正当其时

2019-05-15

我用的table表格来做的

0

好帮手慕码

2019-05-14

同学你好!

可以给每四个盒子外面包一个大div

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

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

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

如果帮助到了你 欢迎采纳 祝学习愉快~

0

好帮手慕码

2019-05-14

同学你好!
about区域中的图文混排一共是八块哦

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

一个大的div容器,里面写八个小的div,分别容纳图片和内容,分别给8个不同的div设置左浮动,这样就能横向显示,并且每个div的宽度设置为25%,这样正好一排显示4个。注意里面字体的大小和颜色的设置,以及位置的定位,需要改变位置的可以使用填充。

如果帮助到了你 欢迎采纳 祝学习愉快~

0
hing111
h 就是上面的代码
h019-05-14
共3条回复

好帮手慕码

2019-05-14

同学你好!

请问同学问的是gallery区域中的六张图片吗?

每一个框都是一个div,6个div盒子是一样宽高的,外面的大盒子是要设置margin:0 auto的,这样就可以自适应居中显示。如下图所示,需要把六个盒子添加浮动显示在一行。

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

此处,只需要定义一个div设置高度和宽度,背景色,以及文字的颜色、字体、大小就能实现。

如果帮助到了你 欢迎采纳 祝学习愉快~

0
hing111
h gallery我还没写出来,上面代码只写到图文介绍那一块,我问的是图片加文字的六块
h019-05-14
共1条回复

0 学习 · 40143 问题

查看课程