2012-02-17 26 views
0

我加入了G +盒子的主頁,並注意到,當我增加或減少瀏覽器的頁面大小網站內容停留在同一個地方 - 而G +盒子移動,涵蓋的內容。我怎樣才能修復相對於內容而不是瀏覽器的徽章?CSS - Google+的軸箱定位

網站Here

的CSS:

html { 
height:100%; 
} 

body { 
background:#000; 
margin: 0; 
padding: 0; 
height:100%!important; 
min-height:750px; 
min-width:980px; 
} 

object, embed { 
vertical-align:top; min-height:750px; outline:none; margin: 0; padding: 0; 
} 

div { 
height: 100%; 
} 

img { 
border:none; vertical-align:top 
} 

.aligncenter { 
text-align:center; 
} 

.google { 
right: 150px; 
top: 600px; 
position: fixed; 
height: 60px; 
border: 0; 
} 

回答

0

如果你想在同一個地方始終保持了G +盒子,爲什麼不創造閃光燈和標誌相對定位的容器和絕對定位一個內部的G +?你的G +盒子doesn't需要有動態的寬度(閃光燈正好居中,但doesn't變化幅度),所以你沒有約束存在。或者我錯過了什麼?

.container { 
position:relative; 
} 
.google { 
position:absolute; 
left: 600px; 
top: 600px; 
height: 60px; 
border: 0; 
} 
0

一個快速的(也許是髒的)解決將是指定righttop也許bottom的百分比。即right: 15%bottom: -1% - 看起來體面我的結束。

另一個解決方案可以是隻寫一個位JavaScript代碼的固定片。 東西沿着

var windowHeight = $(window).height(); 
var gHeight = $('.google').height(); 
var offset = parseInt(windowHeight) - parseInt(gHeight); 
$('.google').css('top',offset); 

行我還沒有測試網站上的驗證碼。這只是一個普遍的想法。

+0

我嘗試了%建議,但如果bw很小,按鈕會在打開時覆蓋頁面......不過好!將嘗試.js文件,看看會發生什麼,但我不是專家 – ubique 2012-02-17 14:37:18