# Tribute project problem

**URL:** <https://forum.freecodecamp.org/t/tribute-project-problem/371873>\
**Category:** General\
**Created:** [April 12, 2020, 8:55am UTC](https://forum.freecodecamp.org/t/tribute-project-problem/371873 "2020-04-12T08:55:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![munli2002](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/munli2002/32/137056_2.png) [@munli2002](https://forum.freecodecamp.org/u/munli2002)\
**Post date:** [April 12, 2020, 8:55am UTC](https://forum.freecodecamp.org/t/tribute-project-problem/371873/1 "2020-04-12T08:55:27Z")

</div>

the userstory asked me to center my image while also put display:block; in the responsive image class ,how can i do to center the image with its parent element?

---

<div class="post-metadata">

**Author:** ![CarCahara](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/carcahara/32/137406_2.png) [@CarCahara](https://forum.freecodecamp.org/u/CarCahara)\
**Post date:** [April 12, 2020, 9:04am UTC](https://forum.freecodecamp.org/t/tribute-project-problem/371873/2 "2020-04-12T09:04:55Z")

</div>

Hi, there are many ways to center an image, one of them:

```auto
img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

```

When you ask questions it’s helpful for others if link to your code on codepen or jsfiddle, or even post the code directly in your question.

---

<div class="post-metadata">

**Author:** ![munli2002](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/munli2002/32/137056_2.png) [@munli2002](https://forum.freecodecamp.org/u/munli2002)\
**Post date:** [April 12, 2020, 9:15am UTC](https://forum.freecodecamp.org/t/tribute-project-problem/371873/3 "2020-04-12T09:15:29Z")

</div>

[https://codepen.io/Henry\_pml/pen/MWaYqre?editors=1000](https://codepen.io/Henry_pml/pen/MWaYqre?editors=1000)

this is my code can u see whrs the problem?

---

<div class="post-metadata">

**Author:** ![yigit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/yigit/32/141863_2.png) [@yigit](https://forum.freecodecamp.org/u/yigit)\
**Post date:** [April 12, 2020, 9:26am UTC](https://forum.freecodecamp.org/t/tribute-project-problem/371873/4 "2020-04-12T09:26:07Z")

</div>

Remove `vertical-align:middle` and change `margin-left` to `margin: 0 auto`. It will do the work.

---

<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:59pm UTC](https://forum.freecodecamp.org/t/tribute-project-problem/371873/5 "2021-06-01T18:59:42Z")

</div>

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


