0
這是另一箇中心覆蓋問題與扭曲。我需要在其父容器中放置一個疊加層。家長中心覆蓋
併發症
- 如果容器是長於屏幕(即垂直滾動條),我需要垂直居中在屏幕和水平在父居中
- 如果包含在屏幕擬合覆蓋(即沒有垂直側邊欄),我需要在父容器中水平和垂直居中疊加。
我目前在兩種情況下都有覆蓋居中的屏幕。
請參閱my homepage(嘗試下面兩種服務的尋呼機)和service list(使用尋呼機)的例子。
我對屏幕居中當前CSS是
.overlay {
display: none;
padding: 20px 0;
text-align: center;
vertical-align: middle;
background: #E9F7FF;
border: 3px solid #97D1F4;
font-size: 1.5em;
color: #97D1F4;
font-weight: bold;
width: 300px;
height: 20px;
position: fixed;
top: 50%;
left: 50%;
margin-top: -10px;
margin-left: -150px;
}
是的,我可以使用jQuery這個工作。但CSS只會是理想的。
謝謝!
馬特