Div에서 텍스트 가운데 맞춤

1443 단어 htmlIEfirefox

<html>
	<head>
		<title>DIV       </title>
		<style type="text/css">
			/*     */
			*{
				margin:0;
				padding:0
			}
			#outer{
				position:relative;
				width:expression(document.body.clientWidth);
				height:expression(document.body.clientHeight);
				border:1px solid #000
			}
			/*for ie*/
			#middle{
				position:absolute;
				top:50%
			}
			#inner{
				position:relative;
				top:-50%;
				width:100%;
				text-align:center
			}
			/*for firefox*/
			#outer[id]{
				position:static;
				display:table
			}
			#middle[id]{
				position:static;
				display:table-cell;
				vertical-align:middle
			}
		</style>
	</head>
	<body>
		<div id="outer">
			<div id="middle">
				<div id="inner">
					      <br/>      <br/>
					      <br/>      <br/>
					      <br/>      <br/>
					      <br/>      <br/>
					      <br/>      <br/>
					      <br/>      <br/>
				</div>
			</div>
		</div>
	</body>
</html>

       

좋은 웹페이지 즐겨찾기