title: How to add a black shadow on top of a div block with background image?
body: <p>I am now creating a website quite similar to this demo website which displays some image on a page and some effects will be shown when hovering on a particular image.
  <a href="https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_templates_portfolio2&amp;stacked=h" rel="nofollow noreferrer">https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_templates_portfolio2&amp;stacked=h</a></p>
  
  <p>In this demo website, when we hover on the image, the opacity of the image will be changed from 0.5 to 1. However, in my website, all the images on the page will be covered by a black layer with opacity is 0.5. When hover mouse on a particular image, the black layer on that image will be disappeared. How can I create this kind of effect? Thank you very much!</p>
  
  <p>In my code, I have something like this:</p>
  
  <pre><code>&lt;div class="img-container"&gt;
  &lt;div style="float:left; background-image:url('img/a.jpg'); width: 100px;height: 100px;"&gt;&lt;/div&gt;
  &lt;div style="float:left; background-image:url('img/b.jpg'); width: 100px;height: 100px;"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to add a black layer with 0.5 opacity on the images? How can I do that?</p>