top of page
Writer's pictureThe Tech Platform

Image Transparency in CSS

Code:

<!DOCTYPE html>
<html>
<head>
<style>
img.one {
  opacity: 30%;
}
img.two{
	opacity: 70%;
    }
    
img.three{
	opacity: 100%;
    }
</style>
</head>
<body>

<h1>Transparency of Image in CSS</h1>
<p>The lower the value, more transparent image will be:</p>

<p>Image with 30% opacity:</p>
<img class="one" src="https://static.wixstatic.com/media/0f65e1_c524ba71d13e425f9e1e9cdad9fc7176~mv2.jpg" alt="Forest" width="400" height="200">

<p>Image with 70% opacity:</p>
<img class="two" src="https://static.wixstatic.com/media/0f65e1_c524ba71d13e425f9e1e9cdad9fc7176~mv2.jpg" alt="Forest" width="400" height="200">

<p>Image with 100% opacity:</p>
<img class="three" src="https://static.wixstatic.com/media/0f65e1_c524ba71d13e425f9e1e9cdad9fc7176~mv2.jpg" alt="Forest" width="400" height="200">

</body>
</html>




Output:





Sofia Sondh

The Tech Platform

1 comment

Recent Posts

See All

1 Comment


kopta
6 days ago

The primary control in Geometry Dash Subzero is to tap or click to make the cube leap. The geometry dash subzero longer you hold the tap, the higher the cube will leap.


Timing Is Everything: Timing your leaps is critical for avoiding obstacles such as spikes, gaps, and other dangers that might derail your progress.

Like
bottom of page