顶部固定div可设置半透明效果

高洛峰
高洛峰 原创
2017-02-23 13:28:41 1940浏览

这篇文章为大家介绍了一个顶部固定的div可设置半透明效果,文末有效果图,大家可以参考下

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<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>

效果图如下:

20161019164751477.gif


更多顶部固定div可设置半透明效果相关文章请关注PHP中文网!


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。