顶部固定div可设置半透明效果
2016-06-17来源:易贤网

代码如下:

<!doctype html public -//w3c//dtd html 4.01 transitional//en >

<html>

<head>

<meta http-equiv=content-type content=text/html; charset=utf-8>

<title>顶部固定</title>

<style type=text/css>

html,body {overflow:hidden;margin:0px;width:100%;height:100%;}

.virtual_body {width:100%;height:100%;overflow-y:scroll;overflow-x:auto;}

.fixed_div {position:absolute;z-index:2008;top:0px;left:0px;right:16px;height:40px;background:#cccccc;border-bottom:3px inset;border-color:#006699;

//bottom:20px;

//border:1px solid red;

//border-style:inset;

//半透明效果制作

//filter:alpha(opacity=50);

//-moz-opacity:0.5;

//opacity:0.5;

//background:#666666;

}

</style>

</head>

<body>

<div class=fixed_div><font color=red>郑州大学</font></div>

<div class=virtual_body>

<div style=height:888px;>

<p>

再见,我一定会回来看你的!

</div>

</div>

</body>

</html>

2026公务员·事业单位培训课程试听报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
推荐信息