我似乎无法理解为什么我的div不会漂浮:对。我希望它出现在页面的右侧,以显示它左侧的镜像。另外,有没有办法在y轴(上下)对中心?如果是这样,怎么样?
我的所有代码都在下面,或者这里是CodePen:http://codepen.io/anon/pen/bNKBJr
HTML:
<div id="page">
<div class="mobile-hidden" style="float:left;position:absolute;">
</div>
<div class="mobile-hidden" style="float:right;position:absolute;">
</div>
<center>
<div class="content">
<div style="font-weight: bold;font-size: 72pt;">
<p>Page Content Here</p>
</div>
<center>
<div style="margin-top:23px;">
</div>
</center></div></center>
</div>
CSS:
.content {
display: inline-block;
margin-top:170px;
font-family: Arial, sans-serif;
text-decoration: none;
color: black;
z-index:10;
width:660px;
}
.mobile-hidden {
display:none;
}
#page {
width:100%;
height:100%;
}
@media screen and (min-width:1260px){
.mobile-hidden {
display:block;
width:300px;
height:100%;
left:0px;
top:0px;
bottom:0px;
right:0px;
z-index:20;
/**/
background-color:#DCDCDC;
/**/
}
}
答案 0 :(得分:2)