css控制div绝对居中问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Matching Game </title>
<meta name="generator" content="editplus" />
<meta name="author" content="lijunliang" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style>
html,body{
height:100%;
}
.wrapper{
height:100%;
}
.left{
width:300px;
margin-right:-300px;
background-color:yellow;
height:100%;
float:left;
}
.right{
margin-left:300px;
background-color:black;
height:100%;
position:relative;
}
.centerit{
height:200px;
width:300px;
top:50%;
left:50%;
position:absolute;
background-color:white;
margin-top:-100px;
margin-left:-150px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="left"></div>
<div class="right">
<div class="centerit">
<div class="inner">
i am in the center
</div>
</div>
</div>
</div>
</body>
</html> 相关推荐
HSdiana 2020-03-28
PioneerFan 2020-06-10
e度空间 2020-04-30
FZfeng 2018-04-04
hhhkhhh 2017-07-20
Ivy 2016-08-14
MrWhite0 2015-11-08
VincentDrW 2011-08-14
Dr凉 2015-06-10
asdjkl 2015-04-30
zhangpeng 2015-03-09
黎豆子 2014-12-03
yibawuqing 2019-06-27