本文介绍了透明背景图象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下css。
#mypass{
background-image: url("Images/logo.png");
background-attachment: fixed;
background-position:140px 100px ;
background-size: 100px;
background-repeat: no-repeat;
opacity:0.5;
fileter:alpha(opacity=40);
color: blue;
}
和iam使用
<div id="mypass">
<center><h2>PRAGATI ENGINEERING COLLEGE</h2>
<h5>1-378,ADB Road,Surampalem-533437,E.G.Dist.,ph:08852-252233</h5></center>
<% out.println("________________________________________________________");
String photo="Image/"+id+".jpeg";
System.out.println(photo);
String yy="";
int y=((1900+d.getYear())-(Integer.parseInt(id.substring(0, 2))+2000))+1 ;
switch(y){
case 1: yy=y+" st";break;
case 2: yy=y+" rd";break;
case 3: yy=y+" rd";break;
case 4: yy=y+" th";break;
default: yy=y+" th";
}
int branch=Integer.parseInt(id.substring(6,8));
System.out.println(branch);
switch(branch){
case 12:yy+=" IT";break;
case 05:yy+=" CSE";break;
case 03:yy+=" MECH";break;
case 02:yy+=" EEE";break;
case 04:yy+=" ECE";break;
default:yy+="PEC";
}
%>
<h2 class="buspass" style="color:#FF33CC"><a class=title onclick="javascipt:window.print(), width=400, height=400" onmouseover="this.style.cursor='hand'">BusPass</a></h2>
<img class="printright" src="<%=photo%>" width="90" height="90" />
<table>
<!-- <tr><td>RollNumber</td><td>: <%=id%></td></tr> -->
<tr ><td>Name</td><td style="color:black">: <%=name%></td></tr>
<tr><td>Class</td><td style="color:black">: <%=yy%></td></tr>
<tr><td>AcadamicYear</td><td style="color:black">: <%=s%></td></tr>
<tr><td>Stage</td><td style="color:black">: <%=pickuppoint%></td></tr>
<tr><td>BusRoute</td><td style="color:black">: <%=routecode%></td></tr>
<!-- <tr><td>SeatNo</td><td>: <%=seatno%></td></tr>-->
<!-- <tr><td>IssueDate</td><td>: <%=ddd%></td></tr> -->
<!-- <tr><td>ValidTill</td><td>: <%=valid%></td></tr> -->
</table>
<h3 class="printrightdown">INCHARGE</h3>
</div>
应用于使用该类的所有元素。说明我想仅使用透明度和过滤器到背景图片。我可以这样做
that is applied to all the elements that uses the class.Instead i want to use opacity and filters only to background image..How can i do it ??
推荐答案
您不能使用CSS调整背景图像的半透明度
You can't adjust the translucency of a background image with CSS.
您可以调整整个元素( opacity
)或纯背景的半透明<$ c $
You can adjust the translucency of an entire element (opacity
) or of a plain background rgba()
, but not a background image.
使用支持本机半透明的图片格式(例如PNG),并嵌入
Use an image format that supports translucency natively (such as PNG) and embed the translucency you want in the image itself.
这篇关于透明背景图象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!