image opacity in html

Solutions on MaxInterview for image opacity in html by the best coders in the world

showing results for - "image opacity in html"
Andrea
14 Jan 2017
1img {
2  opacity: 0.5;
3}
Guillaume
08 Oct 2018
1<html>
2  <head>
3    <style type="text/css">
4      div.imageSub { position: relative; }
5      div.imageSub img { z-index: 1; }
6      div.imageSub div {
7        position: absolute;
8        left: 15%;
9        right: 15%;
10        bottom: 0;
11        padding: 4px;
12        height: 16px;
13        line-height: 16px;
14        text-align: center;
15        overflow: hidden;
16      }
17      div.imageSub div.blackbg {
18        z-index: 2;
19        background-color: #000;
20        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
21        filter: alpha(opacity=50);
22        opacity: 0.5;
23      }
24      div.imageSub div.label {
25        z-index: 3;
26        color: white;
27      }
28    </style>
29  </head>
30    <body>
31      <div class="imageSub" style="width: 300px;"> <!-- Put Your Image Width -->
32        <img src="image.jpg" alt="Something" />
33        <div class="blackbg"></div>
34        <div class="label">Label Goes Here</div>
35      </div>
36    </body>
37</html>
similar questions
queries leading to this page
image opacity in html