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>
运行代码
查看全文
相关阅读:
潜水员(二维DP)
开餐馆(OJ 6045)
石子归并(区间DP)
庆功会(多重背包)
JavaScript案例三:动态显示时间
JavaScript案例二:在末尾添加节点
JavaScript案例一:Window弹窗案例
JavaScript BOM对象介绍
JavaScript模拟函数重载
MapReduce作业和任务
原文地址:https://www.cnblogs.com/jikey/p/1857217.html
最新文章
Accessing the Deep Web: A Survey
一个爬虫
国庆做个作业
每天一up
平衡计分卡
Lesson 31-32 Personal Habits
Lesson 29-30 Who is the real you
Lesson 27-28 Do you like to eat out?
Lesson 25-26 Distractions at the Wheel
Lesson 23-24 Everyday lies
热门文章
Lesson 21-22 What’s on your mind now?
Lesson 19-20 Fast Food
All of Me
Lesson 17-18 Do you get along well with your parents?
Lesson 15-16 Household Chores
乘积最大(NOIP)
能量项链(NOIP 2006 提高组)
统计单词个数(NOIP 2001提高组)
山区建小学(OJ 7624)
数的划分
Copyright © 2011-2022 走看看