

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Add transparency to the background with CSS
<p>Use the <em>opacity </em>property to add transparency to the background of an element. You can try to run the following code to work.</p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/90nthc" rel="nofollow noopener noreferrer" target="_blank">Live Demo</a></p><pre class="prettyprint notranslate"><!DOCTYPE html> <html> <head> <style> div { background-color: #808000; padding: 20px; } div.one { opacity: 0.2; filter: alpha(opacity=20); } div.two { opacity: 0.5; filter: alpha(opacity=50); } </style> </head> <body> <h1>Heading</h1> <p>Check transparency in the below section:</p> <div class = "one"> <p>opacity 0.2</p> </div> <div class = "two"> <p>opacity 0.5</p> </div> <div> <p>opacity 1</p> </div> </body> </html></pre>
- Related Questions & Answers
- With CSS add transparency to a button
- Add a background color to the form input with CSS
- CSS Opacity / Transparency
- Adjusting Text background transparency in Matplotlib
- CSS Transparency Using RGBA
- Repeat the background image with CSS
- Set the Background Attachment with CSS
- Specify the background image with CSS
- Animated background with CSS
- Set the Background Image Position with CSS
- Specify position of the background images with CSS
- Show the background image only once with CSS
- Specify the size of the background images with CSS
- Set the opacity for the background color with CSS
- How to declare the painting area of the background with CSS
Advertisements