zoukankan
html css js c++ java
魔哥Css:背景色透明,内容不透明之终极方法!兼容(不支持ie6)。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>小魔出品</title> <style> body {background:url(http://www.google.com.hk/intl/zh-CN/images/logo_cn.png) 0 0 repeat;} * {margin:0;padding:0;} .Boxer {600px;height:400px;overflow:hidden;margin:0 auto;border:6px solid red;} .Opacity { height:400px; background-color:rgba(0,0,0,0.5); /*标准浏览器 只需这句*/ background-color:#000\9; /*IE 系列*/ filter:alpha(opacity=50); /*IE 系列*/ /* 作为透明背景的层,不可以有 position 属性,不知为何。。。 。 background-color:rgba(0,0,0,0.5) 这句,IE6貌似能读懂一小部分,我艹了。所以只能将background-color:#000 写在其后,然后加个IE的专有Hack。 不信可以写一个试试看 background-color:#000;background-color:rgba(0,0,0,0.5);filter:alpha(opacity=50); IE6会让你蛋疼的! */ } .BoxerInner {position:relative; /*IE 系列*/ text-align:center;font-size:24px;font-weight:700;color:yellow;} </style> </head> <body> <p style="font-size:60px;color:#000;text-align:center;padding:20px;font-weight:700;">Css:背景色透明,内容不透明之终极方法!兼容,终极。</p> <div class="Boxer"> <div class="Opacity"> <div class="BoxerInner">BoxerInner</div> </div> </div> </body> </html>
运行代码
查看全文
相关阅读:
JavaWeb 之 使用 commons-fileupload.jar 实现文件上传
JavaWeb 之 web项目中的路径问题
JavaWeb 之 GET请求和POST请求的乱码问题
URI、URL 和 URN 的区别
JavaWeb 之 ServletConfig 接口
JavaWeb 之 使用开发工具创建 Servlet 程序
JavaWeb 之 GET和POST 请求的分发处理
JavaWeb 【目录】----------------------------------------【目录】
JavaWeb 之 开发工具整合 Tomcat服务器
【LeetCode-数学】Excel表列序号
原文地址:https://www.cnblogs.com/jikey/p/1857217.html
最新文章
git 查看日志尾一行
nodepad++ 行首行尾添加字符
远程仓库版本回退
MybatisCodeHelperPro插件
dubbo-admin和dubbo-monitor的搭建及使用
powerDesigner逆向生成模型注释设置到name
mysql中当前日期的前一天后一天
批量插入数据算法
mysql调用存储过程
AngularJS ng-include 指令
热门文章
HTML DOM Style backfaceVisibility 属性
HTML DOM Embed src 属性
C 练习实例70
Linux date命令
Linux unzip命令
WebAssembly.table.prototype (WebAssembly) – JavaScript 中文开发手册
ionic 网格(Grid)
HTML DOM Form action 属性
AngularJS 服务(Service)
JavaWeb 之 使用 commons-io.jar 实现文件的下载
Copyright © 2011-2022 走看看