CSS makes an element translucent

高洛峰
Release: 2017-03-20 10:45:53
Original
1745 people have browsed it

This article mainly introduces the relevant information on usingCSS to set an element to be translucent. It is very good and has reference value. Friends who need it can refer to it

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

Use it 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, image distortion may occur. You can use IE’s proprietary command:

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

The above is introduced by the editor. Use CSS to set an element to be translucent. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website!

For more articles related to CSS setting an element to be translucent, please pay attention to the PHP Chinese website!

Related articles:

CSS3 Tutorial (8): CSS3 Transparency Guide

Example instructions for using RGBa to adjust transparency in CSS3

Complete code to implement CSS3 opacity

Related labels:
css
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
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!