我正在制作一个网站,但我只想显示一个通知(仅在会员打开网站时显示一次)。此通知必须显示在 html 主页的正上方(因为主页可能会因会员而异)。我想用'opacity'在首页上方做一个淡入淡出的页面(这样会员也可以在通知的四个侧面旁边看到主页),我不能使用“alert”,因为通知包含图片、代码和一些额外的功能诸如正面颜色之类的代码。到目前为止,我发现“不透明度”使用上面的图片,但我如何在我网站的 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;
in 替换为background:"url of my site's homepage";