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.

    d9f96ba0-e25b-4832-aad8-011bd020f2ce-image.png


Log in to reply
 

© Lightnetics 2024