# Tribute page test pass 9/10, image not responsive

**URL:** <https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205>\
**Category:** General\
**Created:** [May 17, 2020, 2:30pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205 "2020-05-17T14:30:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [May 17, 2020, 2:30pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/1 "2020-05-17T14:30:44Z")

</div>

How to pass the image responsive test? please help with the code. thanks in advance.

edit: sorry had to edit few times, since i dont know how to use this forum yet.

the result in the [codepen.io](http://codepen.io) link at bottom

**Your code so far**

```
	#main {
		display: flex;
		flex-direction: column;
		align-items: center;
		background: #DDD340; 
		box-sizing: border-box;
		}
		
	#title {
		width: 100%;
		height: auto;
		text-align: center;
		}
		
	.subtitle {
		font-size: 22px;
		}
	
	#img-div {
		background: #FFEF74;
		border: 2px solid #EB7E00;
		text-align: center;
		margin: 20px;
		padding: 5px;
		}
	
	#image {
		width: 100%;
		height: auto;
		margin: 2px;
		}
	
	#img-caption {
		font-size: 22px;
		margin: 20px;
		}
	
	#tribute-info {
		text-align: left;
		margin: 20px;
		}
	
	#tribute-link {
		background: #C74212;
		color: white;
		}
	
	</style>
</head>

<body id="main">

	<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
	
	<div id="title">
		<h1>DIDI KEMPOT</h1>
		<p class="subtitle">"GodFather of Broken Heart"</p>
	</div>
	
	<div id="img-div">
		<img id="image" src="https://akcdn.detik.net.id/visual/2019/11/01/8b6b7da7-dbf6-4b27-9078-bd6ccc0c95f1_169.jpeg?w=650" alt="Didi Kempot live performance">
		<p id="img-caption">Didi Kempot penyanyi dan pencipta lagu, yang mempopulerkan genre musik Campursari sebagian besar bertema "patah hati" semasa hidupnya.</p>
	</div>

```

\*\*Your browser information:\*\*

User Agent is: `Mozilla/5.0 (Linux; Android 8.0.0; SOV34) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Mobile Safari/537.36`.

**Challenge:** Build a Tribute Page

**Link to the challenge:**  
[https://codepen.io/sobadrdb/pen/wvKYZqP](https://codepen.io/sobadrdb/pen/wvKYZqP)

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [May 17, 2020, 3:06pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/2 "2020-05-17T15:06:09Z")

</div>

So the failing message says;  
`The <img> element should responsively resize, relative to the width of its parent element, without exceeding its original size.`  
`Try using the "max-width" style property : expected 'none' to not equal 'none'`  
You have `width: 100%`

When you correct that and run the tests it will fail in the same place with a different error message;  
`The <img> element should responsively resize, relative to the width of its parent element, without exceeding its original size.`  
`Use the "display" style property with a value of "block" for responsive images.: expected 'inline' to equal 'block'`

When you correct that it will fail in the same place with yet another error message;  
`The <img> element should be centered within its parent element.`  
`Image is not centered: expected 9 to be close to 524 +/- 11`  
You have `margin: 2px` That won’t center. Maybe something like `margin: auto` would help center, right?

Clicking the red button to see the failing test(s) and reading the error message is crucial to resolving issues.

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [May 17, 2020, 3:26pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/3 "2020-05-17T15:26:23Z")

</div>

i just try to set  
#image {max-width: 100% ; margin: auto; }  
but still coame up with error, back to suggest display block.

---

<div class="post-metadata">

**Author:** ![Roma](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/roma/32/112899_2.png) [@Roma](https://forum.freecodecamp.org/u/Roma)\
**Post date:** [May 17, 2020, 3:27pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/4 "2020-05-17T15:27:22Z")

</div>

You need to add all three;

```auto
max-width: 100%;
display: block;
margin: auto;

```

That’s why I say, reading the error message is crucial. It says what the test is looking for and tells you how to correct it.

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [May 17, 2020, 3:35pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/5 "2020-05-17T15:35:06Z")

</div>

thanks for your quick reply,  
yes i did before to change the max-width after reading error.  
i edited on my notepad++ triee it on my browser.  
i tried display: inline;  
maybe because im understanding wrong about that block expected.

and thanks for your solution. now i got that error read better understanding.

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 12, 2020, 7:26pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/6 "2020-06-12T19:26:04Z")

</div>

Hi my name is Andy I am legally blind and i am trying to understand this, here is my code:

```auto
css: 
<style>
* {background-color: red;} 
#main{
    display: center;
    background-color: red;
    color: white;
    text-align: center;
  }

h1 {
  font-family: impact;
  font-size: 50px;
  color: black;
   text-align: center;
  border: 3px solid white;
   font-family: impact;
  font-size: 50px;
  color: black;
}
h2 {
  font-family: impact;
  font-size: 25px;
  color: black;

 
}

    
    #image {
      width: 0;
      height; auto
      max-width; 100%,
      margin: auto;
    }
</style>

html:
<body id="main" style="max-width: 900px">
     <h1 id="title" class="center"> Machel Montano</h1>
   <div id="img-div">
 <img id="image" class="responsive-img" 
      src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/Machel_Montano_%28Reggae_Awards_2007%29.jpg/220px-Machel_Montano_%28Reggae_Awards_2007%29.jpg" </img>

 
       <h2 class="h2" id="img-caption"> Soca Singer Machel Montano Photo with a red Background </h2>
    </div> 
  </div> 

```

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [June 12, 2020, 8:03pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/7 "2020-06-12T20:03:57Z")

</div>

hi @djtriniboya90  
welcome to the forum.  
im sorry to interups, i know you were asking for the moderator Roma to reply .

but i just want to short brief to the codes that you wrote.

first, i believe there is no value of center for display property in css inside your #main id selector.

second, the properties inside your #image id selector shouldn’t have property of width : 0; as it would not showing any image. the three code lines that roma mentioned to have all in to pass the img test is this :

```auto
#image { 
   display: block; /* default value for img element is inline-block */
   max-width: 100%; /* to make sure it fits in the image container, the #img-div container on your code */
   margin: auto; /* to centering image as block level element inside the container, the #img-div container */
}

```

third, in your html, img element is self-closing tag, there is no need to use ` </img> `. and beside that you forgot to close the img tag. in short it should be like this :

```auto
<img id="image" src="your image source link" alt="image description">

```

that’s all i can tell, more than that you’ll need the expert to explains to you.  
as im just a beginner.

happy coding

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 12, 2020, 8:13pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/8 "2020-06-12T20:13:52Z")

</div>

Beginner or expert don’t matter any help is appreciated ill tweak my code and see if it works thanks!

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [June 12, 2020, 8:17pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/9 "2020-06-12T20:17:37Z")

</div>

you’re welcome. sorry for my english, still learning thou.

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 12, 2020, 8:24pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/11 "2020-06-12T20:24:40Z")

</div>

This is what i have right now and its not passing.

```auto
 #img-div {
background-color: red;
margin: 10px;
padding: 10px;

}

#image { 
   display: block;
   max-width: 100%; 
   margin: auto;   

.img {

  display: block;
  margin: auto;
  max-width: 100%;
  height: auto; 
  
}

```

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [June 13, 2020, 7:08am UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/12 "2020-06-13T07:08:07Z")

</div>

hi @djtriniboya90

im sorry i can’t help you with, if only you can link your work on codepen here, maybe i can try to find the clue what the issue.

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 13, 2020, 6:51pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/14 "2020-06-13T18:51:29Z")

</div>

[https://codepen.io/AndyMPCTech/pen/xxZOqWq](https://codepen.io/AndyMPCTech/pen/xxZOqWq)  
here is the link!

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [June 13, 2020, 7:29pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/15 "2020-06-13T19:29:28Z")

</div>

hi,

as i saw your css codes, it turn out it small mistake, typo on your closing bracket of ` p ` property.  
just fix the closing bracket fom ` ) ` to ` } `

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 13, 2020, 7:34pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/16 "2020-06-13T19:34:09Z")

</div>

that dosen’t sove my responsive image problem though

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 13, 2020, 7:40pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/17 "2020-06-13T19:40:02Z")

</div>

I watched a YouTube video and figured out what i was missing!  
Thanks for your help!

---

<div class="post-metadata">

**Author:** ![sobadrdb](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@sobadrdb](https://forum.freecodecamp.org/u/sobadrdb)\
**Post date:** [June 13, 2020, 7:43pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/18 "2020-06-13T19:43:05Z")

</div>

edit : good for you,  
just need to delete this post, as to minimize spoiler.

---

<div class="post-metadata">

**Author:** ![djtriniboya90](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/djtriniboya90/32/153833_2.png) [@djtriniboya90](https://forum.freecodecamp.org/u/djtriniboya90)\
**Post date:** [June 13, 2020, 7:55pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/19 "2020-06-13T19:55:41Z")

</div>

> [@djtriniboya90](#):
>
> I watched a YouTube video and figured out what i was missing!  
> Thanks for your help!

Thanks again for all your help!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 13, 2020, 8:47pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/20 "2020-06-13T20:47:41Z")

</div>

the rules for your `#image` id are missing the closing graph bracket `}`

> [@djtriniboya90](#):
>
> ```css
> #image { 
> display: block;
> max-width: 100%; 
> margin: auto;   
> /* here is missing a thing */
> .img {
> 
> display: block;
> margin: auto;
> max-width: 100%;
> height: auto; 
>   
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 6:49pm UTC](https://forum.freecodecamp.org/t/tribute-page-test-pass-9-10-image-not-responsive/390205/21 "2021-06-01T18:49:58Z")

</div>

Closed on June 1, 2021, 6:49pm UTC


