2016-04-24 37 views
0

我只是想知道,我們可以添加一個粘性頁腳與評論框如WhatsApp在我們的網站上。並在同一頁面上顯示評論。有沒有辦法做到這一點?粘性頁腳與評論框如WhatsApp

這裏是我的HTML代碼

<!DOCTYPE html> <html lang="en-US"> 

<head>  <link rel="stylesheet" href="main.css" type="text/css" /> 
    <title>ChatRoom</title>  </head> 

<body>  <div id="navigation">  <a href="#">test</a> </div> 


    </body> 
</html> 

這裏是我的網站的CSS

body { 
    padding: 0; 
    margin: 0; 
    font-family: Lucida Grande, Helvetica, Arial, sans-serif; 
    font-size: 12px; 
} 

#navigation { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    color: #ffffff; 
    height: 10%; 
    text-align: center; 
    padding-top: 15px; 
    /* Adds shadow to the bottom of the bar */ 
    -webkit-box-shadow: 0px 0px 8px 0px #000000; 
    -moz-box-shadow: 0px 0px 8px 0px #000000; 
    box-shadow: 0px 0px 8px 0px #000000; 
    /* Adds the transparent background */ 
    background-color: rgba(60, 179, 113, 1.0); 
    color: rgba(60, 179, 113, 1.0); 
} 

#navigation a { 
    font-size: 40px; 
    padding-left: 15px; 
    padding-right: 15px; 
    color: white; 
    text-decoration: none; 
} 

#content { 
    width: 600px; 
    padding-top: 70px; 
    padding-bottom: 30px; 
    margin-left: auto; 
    margin-right: auto; 
} 

#content img { 
    padding-top: 20px; 
    padding-bottom: 30px; 
} 

誰能幫助我與它好嗎?

回答

0

不,如果這是你的全部,那麼沒有辦法這樣做。

您需要服務器邏輯來完成您的任務。

1

是的,你確定你可以做到這一點。對於粘性頁腳,技巧是將頁腳absolutebottom:0定位,以便頁腳相對於容器粘到底部。你也需要編寫一些JavaScript邏輯來操縱評論。

下面是該示例的粗略JSFiddle實現。如果您有任何問題要問。希望這可以幫助!