design-wizard design-wizard - 1 month ago 5
CSS Question

CSS is not applying to image

Trying to get css to apply to an image that is contained as below (I have removed other html code to simplify it):

<div class="wrap">
<main>
<article>
<img src="images/forest.jpeg" width="800px">
</article>
</main>
</div>


Currently trying to apply css as follows:

.wrap img {
max-width: 100%;
}

Answer

look css does appy here

.wrap img{
  height: 400px;
  border: 5px solid black;
  border-radius: 10px;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.5);
  max-width: 100%;
}
<div class="wrap">
 <main>
   <article>
     <img src="http://sd.keepcalm-o-matic.co.uk/i-w600/keep-calm-400-level-loading-1.jpg" />
   </article>
 </main>
</div>