css实现半透明的代码分享-创新互联-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

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://kswsj.cn/article/dgscoe.html">http://kswsj.cn/article/dgscoe.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/digijjs.html">linux修改命令和保存 linux常用命令修改</a> </li><li> <a href="/article/digijps.html">html5设置照片大小 html设置图片宽度</a> </li><li> <a href="/article/digijpg.html">android目录控件 android data目录</a> </li><li> <a href="/article/digijje.html">mysql有外键怎么设置 mysql 有外键 怎么修改值</a> </li><li> <a href="/article/digijjg.html">linux脚本执行多命令 linux 脚本中执行命令</a> </li> </ul> </div> </div> <div class="line"></div> <!--底部--> <footer id="5"> <div class="foot1 container"> <div class="list"> <div class="item"> <a href="javascript:;"> <span class="ico1"><i class="iconfont"></i><img src="/Public/Home/img/ewm.png" alt=""></span> <strong>关注我们</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>索要报价</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>我要咨询</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>找到我们</strong> </a> </div> <div class="item"> <a href="" target="_blank"> <span><i class="iconfont"></i></span> <strong>投诉建议</strong> </a> </div> </div> <div class="tel"> <dl> <tel><a href="tel:400-028-6601" target="_blank">400-028-6601</a></tel><br> <span>也许您需要专业的服务,欢迎来电咨询</span> </dl> <dl> <tel><a href="tel:18980820575" target="_blank">18980820575</a></tel><br> <span>您的需求,是我们前进的动力</span> </dl> </div> </div> <div class="friend"> <div class="container"> <span class="tit">友情链接:</span> <div class="inner"> <a href="https://www.cdcxhl.com/tuoguan/yaan/" target="_blank">雅安云锦天府</a><a href="https://www.cdcxhl.com/tuoguan/" target="_blank">成都IDC机房托管</a><a href="https://www.cdcxhl.com/cloud/" target="_blank">成都云服务器租用</a><a href="https://www.cdcxhl.com/gaofang/" target="_blank">高防服务器租用</a><a href="https://www.cdcxhl.com/gaofang/" target="_blank">高防服务器</a><a href="https://www.cdcxhl.com/" target="_blank">建站</a><a href="https://www.cdcxhl.com/" target="_blank">网站设计</a><a href="https://www.cdcxhl.com/xiaochengx.html" target="_blank">成都小程序开发</a><a href="https://www.cdcxhl.com/tuoguan/dianxin/" target="_blank">绵阳服务器托管</a><a href="https://www.cdcxhl.com/google.html" target="_blank">成都谷歌推广</a><a href="https://www.cdcxhl.com/security/" target="_blank">成都等保测评</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文营销</a><a href="https://www.cdcxhl.com/weihu/" target="_blank">成都网站维护</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文推广营销</a><a href="https://www.cdcxhl.com/xiyun.html" target="_blank">西云主机托管</a><a href="https://www.cdcxhl.com/ruanwen/" target="_blank">软文发稿投放平台</a><a href="https://www.cdcxhl.com/wangzhandingzhi.html" target="_blank">成都定制网页设计</a><a href="https://www.cdcxhl.com/xiangyingshi.html" target="_blank">响应式网站建设公司</a> </div> </div> </div> <div class="foot"> <div class="container"> <div class="footNav"> <h3>网站建设</h3> <a href="http://www.kswcd.cn/serve/" target="_blank">专业网站建设</a><a href="http://www.cdkjz.cn/fangan/secu/" target="_blank">安防网站建设方案</a><a href="http://www.cdkjz.cn/fangan/jianshe/" target="_blank">网站建设报价方案</a> </div> <div class="footNav"> <h3>服务器托管</h3> <a href="https://www.cdcxhl.com/tuoguan/" target="_blank">IDC机房托管</a><a href="http://www.cdfuwuqi.com/jigui/" target="_blank">成都机柜租用</a><a href="https://www.cdcxhl.com/idc/cqstsx.html" target="_blank">重庆水土双线托管</a> </div> <div class="footNav"> <h3>网站制作</h3> <a href="http://www.cxhlcq.com/zhizuo/" target="_blank">重庆网站制作</a><a href="http://www.cdxwcx.cn/bj/" target="_blank">网站制作报价</a><a href="http://www.cqcxhl.com/" target="_blank">网站制作</a> </div> <div class="footNav"> <h3>企业服务</h3> <a href="https://www.cdcxhl.com/shoulu/" target="_blank">免费收录网站</a><a href="https://www.cdcxhl.com/shoulu/" target="_blank">分类目录</a><a href="https://www.cdcxhl.com/service/service.html" target="_blank">工商服务</a> </div> <div class="fr ecode"> <div class="fl"> <img src="/Public/Home/img/ewm.jpg"> <p>关注企业微信</p> </div> <div class="fr slogan"> <p class="icon"> <a class="ph" href=""><i class="iconfont"></i></a> <a class="qq" href="tencent://message/?uin=1683211881&Site=&Menu=yes"><i class="iconfont"></i></a> </p> <p> <i>想要找 </i> <a href="">小程序开发</a>、<a href="">APP开发</a>、 <a href="">营销型网站建设</a>、<a href="">网站建设</a>、 <i><a href="">网站定制开发</a></i> ,就选<a href="">创新互联</a> </p> </div> </div> </div> <div class="bottom container"> <p class="fl"> 版权所有:成都创新互联科技有限公司 备案号:<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">蜀ICP备19037934号</a> 服务热线:028-86922220 </p> <p class="fr"> <a href="https://www.cdxwcx.com/" target="_blank">成都网站建设</a>: <a href="https://www.cdcxhl.com/" target="_blank">创新互联</a> </p> </div> </div> </footer> <!--在线咨询--> <div class="fot"> <ul> <li> <a href="https://p.qiao.baidu.com/cps/mobileChat?siteId=11284691&userId=6256368&type=1&reqParam=%20{%22from%22:0,%22sessionid%22:%22%22,%22siteId%22:%2211284691%22,%22tid%22:%22-1%22,%22userId%22:%226256368%22,%22ttype%22:1,%22siteConfig%22:%20{%22eid%22:%226256368%22,%22queuing%22:%22%22,%22siteToken%22:%226ce441ff9e2d6bedbdfc2a4138de449e%22,%22userId%22:%226256368%22,%22isGray%22:%22false%22,%22wsUrl%22:%22wss://p.qiao.baidu.com/cps3/websocket%22,%22likeVersion%22:%22generic%22,%22siteId%22:%2211284691%22,%22online%22:%22true%22,%22webRoot%22:%22//p.qiao.baidu.com/cps3/%22,%22bid%22:%22160142915792139572%22,%22isSmallFlow%22:0,%22isPreonline%22:0,%22invited%22:0%20},%22config%22:%20{%22themeColor%22:%224d74fa%22%20}%20}&appId=&referer=&iswechat=0&expectWaiter=-1&openid=null&otherParam=null&telephone=null&speedLogId=null&eid=null&siteToken=6ce441ff9e2d6bedbdfc2a4138de449e" target="_blank"> <img src="/Public/Home/img/fot1.png" alt=""> <p>在线咨询</p> </a> </li> <li> <a href="tel:18980820575" target="_blank"> <img src="/Public/Home/img/fot2.png" alt=""> <p>拨打电话</p> </a> </li> </ul> </div> </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>