Detailed example of setting an element to be translucent using CSS

小云云
Release: 2017-12-22 16:50:02
Original
1373 people have browsed it

Will you use CSS to set an element to be translucent? This article mainly introduces the relevant information about using CSS to set the translucency of an element. It is very good and has reference value. Friends who need it can refer to it. I hope it can help everyone.


.opacity{  filter:alpha(opacity=50);       
/* IE */  -moz-opacity:0.5;              
/* 老版Mozilla */  -khtml-opacity:0.5;              
/* 老版Safari */  opacity: 0.5;           
/* 支持opacity的浏览器*/}
Copy after login

Used to set an element to be semi-transparent


.filter = "alpha(opacity=" + opacity + ")";    
/* IE */ .MozOpacity = (opacity / 100);                 
/* 老版Mozilla */ .KhtmlOpacity = (opacity / 100);               
/* 老版Safari */ .opacity = (opacity / 100);                    
/* 支持opacity的浏览器*/
Copy after login

When scaling images on the Windows platform, there may be To prevent image distortion, you can use IE's proprietary command:


img{-ms-interpolation-mode: bicubic;}
Copy after login

Have you learned this? Hurry up and give it a try.

Related recommendations:

CSS setting image turns gray_html/css_WEB-ITnose

##Detailed explanation of CSS3 filter Mirror attribute

Detailed explanation of CSS3 filter attribute

The above is the detailed content of Detailed example of setting an element to be translucent using CSS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!