-1

In my code CSS is no longer working, the CSS which I applied to the sections!

This image doesn't shrink, what am I missing out?

in website:

In HTML Code is:

<section  class="sec5 container">
   <div class="blockcontainer">
      <img src="img/campanha.jpg">
   </div>

In CSS is:

.blockcontainer{
  width: 10%;
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
 }
TylerH
  • 20,799
  • 66
  • 75
  • 101
  • 2
    (offtopic) You have `.blockcontainer` (without underscore) and `.block_container` (with underscore) That won't work. – GreyRoofPigeon Mar 05 '18 at 15:11
  • Chrome > Right Click > Inspect Element > Check what CSS rules are being applied or what is overwriting yours – musefan Mar 05 '18 at 15:11
  • 1
    You aren't defining any dimensions for the image. `.block_container img { width: 100% }` – Turnip Mar 05 '18 at 15:13

2 Answers2

0

You have a mistake in your CSS,

.blockcontainer{
  width: 10%;
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
 }
.blockcontainer img{
  width: 100%;
}

.block_container should be changed into .blockcontainer

Nadun Kulatunge
  • 1,567
  • 2
  • 20
  • 28
0

Try this:

 .blockcontainer img{
      width: 100%;
      display: block;
     }
Tasos Fel
  • 331
  • 2
  • 6