189 8069 5689

css实现半透明的代码分享-创新互联

本篇内容主要讲解“css实现半透明的代码分享”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“css实现半透明的代码分享”吧!

10年积累的成都做网站、网站建设、外贸营销网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先建设网站后付款的网站建设流程,更有蔚县免费网站建设让你可以放心的选择与我们合作。

DIVCSS半透明基础介绍设置DIV半透明CSS代码:

div{filter:alpha(Opacity=80);-moz-opacity:0.5;opacity:0.5;}

说明:

1、filter:对winIE设置半透明滤镜效果,filter:alpha(Opacity=80)代表该对象80%半透明,火狐浏览器不认

2、-moz-opacity:对mozillafirefox火狐浏览器实现半透明,winIE不认此属性,-moz-opacity:0.5相当于设置半透明为50%

3、opacity:对除IE外所有浏览器支持包括谷歌,放最后主要针对谷歌浏览器,opacity:0.5;表示设置50%半透明

为了观察到对DIV半透明实现,我们设置两个DIV层,分别一个放于另外一个DIV层内,外层DIV命名为“.div-a”;上面被包含的层CSS类命名为“.div-b”,形成“.div-b”盒子放于“.div-a”内

我们对底层DIV设置一个背景是一张图片,上面的DIV盒子设置村黑色。

未设置CSS半透明样式实例

根据描述实例,未设置半透明HTML源代码:

半透明实例在线演</p><p><style></p><p>.div-a{background:url(div-a-bg.png)no-repeat;width:230px;height:136px;padding:10px;}</p><p>.div-b{background:#000;width:200px;height:100px;padding:5px;color:#F00}</p><p></style></p><p></head></p><p><body></p><p><divclass="div-a"></p><p><divclass="div-b">DIV半透明实例演示</div></p><p></div></p><p></body></p><p></html></p><p>到此,相信大家对“css实现半透明的代码分享”有了更深的了解,不妨来实际操作一番吧!这里是<a href="https://www.cdcxhl.com/" target="_blank">创新互联建站</a>,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!</p><br/> <br> 本文标题:css实现半透明的代码分享-创新互联 <br> 链接URL:<a href="http://www.finscp.com/article/dgscoe.html">http://www.finscp.com/article/dgscoe.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/hdsceh.html">oracle怎么使用数组,oracle中数组使用</a> </li><li> <a href="/article/hdscee.html">python绘图抛点函数,python画抛物线函数</a> </li><li> <a href="/article/hdsdhs.html">vb.net+图像刷新,vb刷新界面</a> </li><li> <a href="/article/hdscep.html">sqlserver出栈,sqlserver启动失败</a> </li><li> <a href="/article/hdscco.html">nosql数据库集群,NoSql数据库</a> </li> </ul> </div> </div> <footer> <div class="foot container"> <div class="footl fl"> <h3>联系我们</h3> <dl> 您好HELLO!<br> 感谢您来到大邑网站建设公司,若您有合作意向,请您为我们留言或使用以下方式联系我们, 我们将尽快给你回复,并为您提供真诚的设计服务,谢谢。 </dl> <ul> <li>电话:028- <span>86922220 18980695689</span></li> <li>商务合作邮箱:631063699@qq.com</li> <li>合作QQ: 532337155</li> <li>成都网站设计地址:成都市青羊区锣锅巷31号五金站写字楼6楼</li> </ul> </div> <div class="footr fr"> <h3>昊豪耀航建站公司</h3> <dl> 大邑昊豪耀航网站建设公司拥有多年以上互联网从业经验的团队,始终保持务实的风格,以"帮助客户成功"为已任,专注于提供对客户有价值的服务。 我们已为众企业及上市公司提供专业的网站建设服务。我们不只是一家网站建设的网络公司;我们对营销、技术、管理都有自己独特见解,昊豪耀航建站采取“创意+综合+营销”一体化的方式为您提供更专业的服务! </dl> <h3>昊豪耀航观点</h3> <dl> 相对传统的大邑网站建设公司而言,昊豪耀航是互联网中的网站品牌策划,我们精于企业品牌与互联网相结合的整体战略服务。<br> 我们始终认为,网站必须注入企业基因,真正使网站成为企业vi的一部分,让整个网站品牌策划体系变的深入而持久。 </dl> </div> </div> <div class="link"> <div class="container"> <span> 友情链接:</span> <a href="http://www.amruizhi.cn/" title="公司注册服务" target="_blank">公司注册服务</a>   <a href="http://www.fdjweixiu.com/" title="成都发电机维修" target="_blank">成都发电机维修</a>   <a href="http://www.hkccoic.com/" title="四川國際商會" target="_blank">四川國際商會</a>   <a href="http://www.hirschbrau.com/" title="成都发电机选购" target="_blank">成都发电机选购</a>   <a href="http://www.ejutwnk.com/" title="太阳能庭院灯" target="_blank">太阳能庭院灯</a>   <a href="https://www.cdcxhl.com/mianfei/jianshe/chengdu.html" title="成都免费网站建设公司" target="_blank">成都免费网站建设公司</a>   <a href="http://www.xhgfhy.com/ " title="雨棚定制" target="_blank">雨棚定制</a>   <a href="https://www.cdcxhl.com/mobile.html" title="手机网站制作" target="_blank">手机网站制作</a>   <a href="http://www.cqganxi.com/" title="绵阳IDC机房" target="_blank">绵阳IDC机房</a>   <a href="http://www.aevdf.com/" title="巴中柴油发电机组" target="_blank">巴中柴油发电机组</a>    </div> </div> <div class="copy"> © Copyright 2026 <a href="http://www.finscp.com">昊豪耀航建站公司</a>All Rights Reserved.  <a href="http://beian.miit.gov.cn" target="_blank" rel="nofollow">蜀ICP备2021004003号-2</a>  <a href="https://www.cdxwcx.com" target="_blank">成都网站建设</a> / <a href="https://www.cdxwcx.com" target="_blank">成都网站建设</a> / <a href="https://www.cdxwcx.com" target="_blank">响应式网站建设</a> / <a href="https://www.cdcxhl.com" target="_blank">成都网站设计</a>  <a href="https://www.cdcxhl.com/service/weihu.html" target="_blank">成都网站维护</a> <a href="https://www.cdcxhl.com/news/" target="_blank">其他新闻分类</a> </div> </footer> </body> </html> <script> $(".con img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>