CSS+DIV 区块居中布局

div和span区别:

  div将页面分成若干个区块

  span将一行内分划成几个区域

<html>
	<head>
			<style type="text/css">
				#main{
					width:460px;
					margin-top:0px;
					margin-right:auto;
					margin-bottom:0px;
					margin-left:auto;
				}
				#left{
					background:#CCCCCC;
					float:left;
					height:304px;
					width:220px;
					border:9px soild#930304;
				}
				#right{
					background:#CCCCCC;
					float:left;
					height:304px;
					width:220px;
					border:9px soild#930304;
				}
		  </style>
	</head>
  <body>
		<div id="main">
			<div id="left">左侧</div>
			<div id="right">右侧</div>
		</div>
  </body>
</html>

 

你可能感兴趣的:(Web,css,div,RIA)