2013-01-16 33 views
2

我的網站有問題。我創建了一個可以打開聊天的按鈕。但是這個按鈕不能保留在所有瀏覽器和屏幕顯示器的正確位置。由於瀏覽器縮放,按鈕不會像我想要的那樣。在每個瀏覽器中製作一個按鈕

這是我的網頁:http://www.assembleia.org.br/site/webtv/

CHAT按鈕需要後箱是正確的,喜歡這張照片:http://imageshack.us/photo/my-images/20/cssfix.jpg/

但在其他瀏覽器中,該按鈕進入到右,右。 這裏是我的CSS:

<style> 

* { /* trying to RESET CSS */ 
    margin: 0; 
    padding: 0; 
    list-style: none; 
    vertical-align: baseline; 
} 

#tab /* the button CHAT */{ 
    min-width: 50px; 
    min-height: 19px; 
    max-width: 50px; 
    max-height: 19px; 
    position: absolute; 
    right: 27%; 
/*float: left;*/ 
    top: 350px; 
    display: block; 
    cursor: pointer; 
    background-image: url('http://www.assembleia.org.br/site/wp-content/uploads/2013/01/buttonchat.png'); 
    color: white; 
} 

#panel /* the panel */ { 
    min-height: 367px; 
    position:absolute; 
    left: 1355px; 
    top: 171px; 
    background-color: #D4D4D4; 
    max-height: 367px; 
    min-width: 0; /*new line*/ 
} 

#panel .content /* for the chat */ { 
    min-width: 100px; 
    text-align: center; 
    /*margin-right:300px;*/ 
    margin-right: auto; 
    max-width: 100px; 
} 

#close /* for the little red X after opening the chat */ { 
    position: absolute; 
    left: 1758px; 
    top: 168px; 
    background-image: url('http://www.assembleia.org.br/site/wp-content/uploads/2013/01/buttonclose1.png'); 
    text-decoration: none; 
} 

#share /* for facebook sharing after opening the chat */ { 
    position: absolute; 
    left: 1656px; 
    top: 540px; 
    font-size: 10px; 
    font-family: Verdana,sans-serif; 
} 

</style> 

THX ..

回答

0

使用的位置是:相對的;屬性在您的父包裝div,然後更改#tab CSS如下:

  • 添加位置:絕對;
  • 更改頂部到頂部:50%;
  • 將權利更改爲右:25px;

這是使用Firebug進行測試,應該給予所需的效果。

+0

試圖把**的位置是:相對; ** **上面板#**。內容並沒有奏效。然後嘗試將**位置:相對; **放在**#面板**上,將**#選項卡**更改爲**頂部:30%**和**右邊:27%** - 在我的瀏覽器上工作,但在其他桌面,而不是。謝謝! –

+0

如果你完全按照我告訴過的那麼它會工作。否則,它不會。如果這是答案,那麼請將其標記爲如此。 –

1

使用本

#tab { 
min-width: 50px; 
min-height: 19px; 
max-width: 50px; 
max-height: 19px; 
position: absolute; 
right: 50px; 
top: 350px; 
display: block; 
cursor: pointer; 
background-image: url('http://www.assembleia.org.br/site/wp-content/uploads/2013/01/buttonchat.png'); 
color: white; 
} 
+0

不得不改變權利:27%,然後在我的筆記本上,但在桌面上,而不是。非常感謝你! –

+0

不使用'%'。我不知道爲什麼但我認爲px比%更好。也改頂:350px; –