Home >Web Front-end >CSS Tutorial >How Can I Make a Div's Background Transparent While Keeping Text Opaque in All Browsers?
Opacity Effects on Background-Color without Impacting Text
Achieving transparency in a div's background while maintaining opaque text requires a cross-browser solution that addresses Internet Explorer 6.
To accomplish this without external libraries:
.alpha60 { background-color: rgba(0, 0, 0, 0.6); }
.alpha60 { filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; }
The above is the detailed content of How Can I Make a Div's Background Transparent While Keeping Text Opaque in All Browsers?. For more information, please follow other related articles on the PHP Chinese website!