我正在製作一個網站,但我只想顯示一條通知(只有當成員打開網站時)。此通知必須顯示在html主頁上方(因爲主頁可能會因成員而改變)。我想使用'不透明'在主頁上方製作一個淡入淡出的頁面(以便成員也可以在通知的四面看到主頁),我不能使用「提醒」,因爲通知包含圖片,代碼和一些額外的功能的代碼,如前面的顏色。到目前爲止,我發現'不透明'使用上面的圖像,但我怎麼能在我的網站的html主頁上面使用'不透明'?我想在我的網站的html主頁上使用'不透明'。我可以使用它嗎?
<html>
<head>
<style>
div.bacgro
{
width:500px;
height:250px;
background:url of a jpg file;
border:2px solid black;
}
div.trabox
{
width:400px;
height:180px;
margin:30px 50px;
background-color:#ffffff;
border:1px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
div.trabox p
{
margin:30px 40px;
font-weight:bold;
color:#000000;
}
</style>
</head>
<body>
<div class="bacgro">
<div class="trabox">
<p>This is some text that is placed in the transparent box. It may contain some code and small profile image also ...
</p>
</div>
</div>
</body>
</html>
,但最重要的是我想替換background:url of a jpg file;
到background:"url of my site's homepage";
的一部分,你有什麼已經嘗試過? – BenM