我在我的網站下面的div:DIV + CSS高度調節
<!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></title>
<style type="text/css">
.popup
{
float: left;
position: fixed;
top: 50%;
left: 50%;
margin-left: -332px;
margin-top: -260px;
width: 665px;
height: 550px;
border: solid 1px blue;
z-index: 100;
}
</style>
</head>
<body>
<div class="popup" >content content content...</div>
body body body.....
<br />
</html>
和這個CSS
.popup
{
float:left;
position: fixed;
top: 50%;
left: 50%;
margin-left: -332px;
margin-top: -260px;
width: 665px;
height:550px;
z-index:100;
}
我有一個問題,當屏幕resoultion低於股利未完全顯示1024x768(即800x600)。彈出窗口的頂部和底部將被剪切。
我正在尋找一個CSS代碼或js來檢測客戶端的resoultion低於600(高度),並將調整div高度並添加滾動條。 爲所有其他客戶我想保持div高度550px;
溢出:汽車;最大高度:90%;最大寬度:90%;將解決大小和滾動條 - 但不是中心,這取決於像素大小。 – Quentin 2010-01-13 12:57:12