前端入门——HTML&CSS实战1

导航+照片排版
在这里插入图片描述

瀑布流 —— 分栏
在这里插入图片描述

代码

<!--html-->
<!DOCTYPE html>
<html>
  <head>
    <title>我的相册</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <link rel="stylesheet" type="text/css" href="css/mytest1.css">

  </head>
  
  <body>
    <div class="contain">
    	<div class="wrapper">
    		<div class="header">
    			<div class="header_contain">
    				<div class="header_title">我的相册</div>
    				<div class="header_nav">
    					<ul>
    						<li><a href="#">首页</a></li>
    						<li><a href="#">个人中心</a></li>
    						<li><a href="#">我的相册</a></li>
    						<li><a href="#">我的访客</a></li>
    					</ul>
    					<div class="header_img">
    						<img alt="" src="img/warming.jpg">
    					</div>
    					<div class="header_search">
    						<form action="">
    							<input type="text">
    						</form>	
    					</div>
    				</div>
    		 	</div>
    		</div>
    		<div class="body">
    			<img alt="点击我" src="img/p1.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p2.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p3.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p4.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p4.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p6.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p7.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="body">
    			<img alt="点击我" src="img/p1.jpg" width="200px" height="200px">
    			<div class="img_text">风吹雨成花❀</div>
    		</div>
    		
    		<div class="footer">
			<div><img alt="" src="img/p11.jpg"></div>
			<div><img alt="" src="img/p22.jpg"></div>
			<div><img alt="" src="img/p33.jpg"></div>
			<div><img alt="" src="img/p55.jpg"></div>
			<div><img alt="" src="img/p44.jpg"></div>
			<div><img alt="" src="img/p77.jpg"></div>
			<div><img alt="" src="img/p11.jpg"></div>
			<div><img alt="" src="img/p22.jpg"></div>
			<div><img alt="" src="img/p55.jpg"></div>
			<div><img alt="" src="img/p44.jpg"></div>
			<div><img alt="" src="img/p33.jpg"></div>
			<div><img alt="" src="img/p77.jpg"></div>
			<div><img alt="" src="img/p22.jpg"></div>
			<div><img alt="" src="img/p33.jpg"></div>
			<div><img alt="" src="img/p55.jpg"></div>
			<div><img alt="" src="img/p44.jpg"></div>
			<div><img alt="" src="img/p77.jpg"></div>
			<div><img alt="" src="img/p11.jpg"></div>
			<div><img alt="" src="img/p22.jpg"></div>
			<div><img alt="" src="img/p55.jpg"></div>
			<div><img alt="" src="img/p44.jpg"></div>
			<div><img alt="" src="img/p33.jpg"></div>
			<div><img alt="" src="img/p77.jpg"></div>
		</div>
    		
    	</div>
    </div>
  </body>
</html>


<!--css-->
*{
	margin:0px;
	padding:0px;
}

body{
	background-color:#FEF4F4;
}

.wrapper{
	width:80%;
	height:10000px;
	background-color:#FBDAC8;
	margin:0px auto;
}

.header{
	width:100%;
	height:100px;
	background-color:#F3a68c;
	margin:0px auto;
}

ul{
	list-style:none;
	float:left;
	margin-left:100px;
	margin-top:30px;
}

.header_title{
	float:left;
	font-family:cursive;
	font-size:40px;
	color:#ddeab2;
}

.header_contain{
	margin:30px;
	padding:30px;
}

.header_nav{
	padding-top:0px;
	
}

li{
	padding-left:0px;
	display:inline;
}

a:link,a:visited{
	color:darkgrey;
	text-decoration:none;
	text-align:center;
	font-size:20px;
	padding:10px;
	font-family:cursive;
}

a:hover,a:active{
	color:dimgrey;
}

.header_img img{
	width:40px;
	height:40px;
	border-radius:30px;
	display:inline;
	float:right;
	margin-top:15px;
}

.header_search form{
	float:right;
	width:100px;
	height:30px;
	position:relative;
	margin-right:90px;
	margin-top:22px;
}

.header_search input{
	height:20px;
	border-radius:30px;
}

.body{
	border:1px solid darkgray;
    width:auto;
	height:auto;
	float:left;
	margin:30px;
}

img{
	opacity:1;  //透明度0-1
}

.img_text{
	font-size:15px;
	margin-bottom:5px;
	color:#b47226;
	text-align:center;
}

.footer{
	column-width:250px;
	-webkit-column-width:250px;
	column-gap:5px;
	margin-top:1000px;
   
}

.footer div{
	width:250px;
	margin:5px auto;
}


瀑布流主要是以分栏为主

属性描述
column-count:3分为3栏
column-gap:30px设置栏的间距
column-rule:5px outset red设置分栏的样式
column-width:250px
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值