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> 标题网址:<a href="http://csruizhi.cn/article/dgscoe.html">http://csruizhi.cn/article/dgscoe.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/phoide.html">兼容浏览器的cssinline-block写法是怎样的</a> </li><li> <a href="/article/phoioi.html">JavaScript事件对象event用法分析</a> </li><li> <a href="/article/phoeio.html">如何优化微信小程序</a> </li><li> <a href="/article/phoidc.html">mysql的Incorrectdatetimevalue报错问题怎么解决</a> </li><li> <a href="/article/phoido.html">Java如何使用Jetty实现嵌入式的Servlet容器</a> </li> </ul> </div> </div> <div class="footer2"> Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号 <br />友情链接: <a href="https://www.cdxwcx.com/wangzhan/mobile.html" target="_blank">手机网站建设 </a><a href="https://www.cdcxhl.com/h5.html" target="_blank">成都h5网站建设 </a><a href="http://m.cdcxhl.cn/seo/" target="_blank">成都网站建设 </a><a href="http://chengdu.cdxwcx.cn/" target="_blank">成都网站设计 </a><a href="http://www.cxjianzhan.com/mobile/" target="_blank">企业手机网站建设 </a><a href="https://www.cdxwcx.com/" target="_blank">成都网站制作 </a><a href="http://www.kswcd.com/service/" target="_blank">高端网站建设 </a><a href="http://m.cdcxhl.com/muban.html" target="_blank">成都模版网站建设 </a><a href="http://www.kswcd.com/solution/" target="_blank">网站建设方案 </a><a href="http://www.cxhljz.cn/" target="_blank">成都网站设计 </a><a href="https://www.cdcxhl.com/" target="_blank">成都网站制作 </a><a href="http://seo.cdkjz.cn/yingxiao/" target="_blank">营销型网站建设 </a><a href="http://www.cxjianzhan.com/" target="_blank">网站制作 </a><a href="http://www.kswcd.cn/" target="_blank">专业网站建设 </a><a href="http://www.cqwzjz.cn/" target="_blank">重庆网站建设 </a><a href="http://www.cdkjz.cn/" target="_blank">网站建设 </a><a href="http://chengdu.cdcxhl.com/dingzhi/" target="_blank">定制网站建设 </a><a href="http://chengdu.cdcxhl.com/" target="_blank">营销型网站建设 </a><a href="https://www.cdcxhl.com/pinpai.html" target="_blank">高端网站设计 </a><a href="http://chengdu.cdcxhl.com/" target="_blank">成都网站建设 </a><a href="https://www.cdcxhl.com/sheji/chengdu.html" target="_blank">四川成都网站设计 </a><a href="http://www.kswsj.com/" target="_blank">成都网站设计 </a></div> </body> </html> <script src="/Public/Home/js/wow.min.js"></script> <script> if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) { new WOW().init(); }; </script> <div class="sidebar"> <ul> <li><a href="http://wpa.qq.com/msgrd?v=3&uin=244261566&site=www.csruizhi.cn&menu=yes" target="_blank"><img src="/Public/Home/images/right_qq.png" /></a></li> <li><a href="http://wpa.qq.com/msgrd?v=3&uin=1683211881&site=www.csruizhi.cn&menu=yes" target="_blank"><img src="/Public/Home/images/qq.png" /></a></li> <li class="tel"><a href="tel:028-86922220"><img src="/Public/Home/images/right_tel.png" /></a></li> <div class="wx"> <span class="weixin"><img src="/Public/Home/images/weixin.jpg"><br> 微信扫一扫在线咨询</span> </div> <li><a class="fx" href="#hero"><img src="/Public/Home/images/right_up.png" /></a></li> </ul> </div> <script type="text/javascript"> $(function () { $('.sidebar .fx').click(function () { $('html,body').animate({ scrollTop: '0px' }, 800); }); }); </script> <script type="text/javascript"> $(document).ready(function () { $("#fancybox-manual-b").click(function () { $.fancybox.open({ href: 'map.html', type: 'iframe', padding: 5 }); }) }); </script> <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>