DIV領域を上下左右中央に設置するCSS・HTMLコード
<style type=”text/css”>
body {
background:#ccc;
margin:0;
padding:0;
}
#wrap {
position:absolute;
width:500px;
height:100px;
left:50%;
top:50%;
margin-left:-250px;
margin-top:-50px;
background:#fff;
color:#999;
}
</style>
■HTML
<body>
<div id=”wrap”>locate div at the center vertically and horizontally.</div>
</body>
トラックバック URL :
コメント (5463)