css opacity

 

(1)#a{opacity:0.7;}或者#a{opacity:.7;}(1不透明,0完全透明,精确度可以达到0.01,不过区别不是很大)//IE9,和其他都行

(2)#a{filter:alpha(opacity=10);}(100不透明,0完全透明)//理论上IE6、7、8可以,但是IETest中的IE6不行,有待考究

(ps:上面的CSS使用专用的filter属性来设置IE6-8透明度。对于IE6和IE7需要注意:为了使得透明设置生效,元素必须是“有布局”。一个 元素可以通过使用一些CSS属性来使其被布局,有如width 和 position。)

(3)js:document.getElementById("a").style.opacity="0.4";//IE外所有浏览器以及IE9

           document.getElementById("a").style.filter="alpha(opacity=40)";//针对IE

(4)jQuery:$("#a").css({"opacity":0.4});//所有通用

(5)css3中rgba:#a{background:ragb(90,90,90,0.4);}//前面三个是定义颜色,后面是定义不透明度

        css3中hsla: #a {background: hsla(207, 38%, 47%, .4);}//Hue(色调), Saturation(饱和度), Lightness(亮度), 和Alpha

     这两个的好处是不会影响子元素,只改变背景的颜色

jsf和jpa 期末大作业 <%@ page language="java" import="java.util.*,dao.*,entitybean.*" pageEncoding="utf-8"%> <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <f:view> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <style type="text/css"> </style> </head> <body > <div style="position:absolute; width:100%; height:100%; z-index:-1;background-color:#2894FF;background-repeat : no-repeat;background-size:90% 90%;opacity:1"> <img src="image/re2.jpg"> <h3>人事信息管理</h3> <p style="text-align:center"> <h:outputLink value="/faces/add.jsp">添加一条</h:outputLink> <h:form> <h:dataTable value="#{loginBean.persons}" var="person" border="5" cellpadding="5" cellspacing="2"> <h:column> <f:facet name="header"> <h:outputText id="headerText1" value="职工号"/> </f:facet> <h:outputText value="#{person.id}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText2" value="姓名"/> </f:facet> <h:outputText value="#{person.name}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText3" value="性别"/> </f:facet> <h:outputText value="#{person.gender}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText4" value="年龄"/> </f:facet> <h:outputText value="#{person.age}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText5" value="国籍"/> </f:facet> <h:outputText value="#{person.address_country}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText6" value="详细地址"/> </f:facet> <h:outputText value="#{person.address_detail}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText7" value="邮编"/> </f:facet> <h:outputText value="#{person.address_zip}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText8" value="入职时间"/> </f:facet> <h:outputText value="#{person.entry_time}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText9" value="所属部门"/> </f:facet> <h:outputText value="#{person.depertment}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText10" value="职位"/> </f:facet> <h:outputText value="#{person.position}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="headerText11" value="工资"/> </f:facet> <h:outputText value="#{person.salary}"/> </h:column> <h:column> <h:outputLink value="faces/edit.jsp" > <h:outputText value="编辑"></h:outputText> <f:param name="p_id" value="#{person.id}"/> </h:outputLink> </h:column> <h:column> <h:outputLink value="delete.jsp" > <h:outputText value="删除"></h:outputText> <f:param name="p_id" value="#{person.id}"/> </h:outputLink> </h:column> </h:dataTable> </h:form> </p> <img src="image/re.jpg"> </div> </body> </html> </f:view>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值