我有一个静态图像作为背景启动(800x600px),它由一个特定位置的空白区域组成,需要用一个文本框填充,这个启动页面以所有分辨率为中心(下面的 CSS 代码)
我能够在特定的屏幕分辨率上正确对齐它,但是当我以不同的分辨率看到它时,框会移出位置。
CSS / HTML:
.centeredSplash {
position:relative;
width:100%;
height:100%;
background:url(Coming-soon.png) center center no-repeat;
}
.roundcorner{
position:absolute;
background-color: #000;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border: 0px solid #000;
padding: 15px;
width: 350px;
v-align:top;
/*bottom:34%;*/
bottom : 420px;
right:50%;
margin-right: -190px;
}
input
{
-webkit-border-radius: 5px; //For Safari, etc.
-moz-border-radius: 5px; //For Mozilla, etc.
border-radius: 5px;
float:left;
}
<div class="centeredSplash">
<div class="roundcorner">
<input type="text" style="width:269px;margin-right: 10px" id="email"/>
</div>
</div>
这在某些分辨率下可以正常工作,但对于更高的分辨率,“圆角”会一直浮动到尴尬的位置,我如何锁定任何分辨率的位置,即相对于始终根据分辨率居中的启动页面图像?