How do i make an image opaque using html/css?
-
Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/CSS/opacity
The opacity of an element can be changed using a combination of html/css.
Usually the css (stylesheet) is in a separate file. The style is in-between the
<style></style>
html attribute. The opacity set to 5% compared to the original.<style> img.example { opacity: 0.5; } </style> <div> <img src="treeseedling.jpg"> <img class=example src="treeseedling.jpg"> </div>
Results, original marked with red highlighter.
© Lightnetics 2024