# Help with my Background Picture

**URL:** <https://forum.freecodecamp.org/t/help-with-my-background-picture/54914>\
**Category:** General\
**Created:** [November 13, 2016, 2:20pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914 "2016-11-13T14:20:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justinhed](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/justinhed/32/97419_2.png) [@Justinhed](https://forum.freecodecamp.org/u/Justinhed)\
**Post date:** [November 13, 2016, 2:20pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/1 "2016-11-13T14:20:58Z")

</div>

Hi all,

I am doing my Tribute page but i would like to find out as i a sure i am doing it wrong. I would like to have my one picture as the full background. This is the code that I have: (which i googled)

html { background: url([http://www.theboxmag.com/content/content/9742/Rich-Froning.jpg](http://www.theboxmag.com/content/content/9742/Rich-Froning.jpg)) center fixed;  
webkit-background-size: cover;  
moz-background-size: cover;  
o-background-size: cover;  
background-size: cover;  
}

But it is cutting the picture at the top and the bottom…Can someone please help me get this right?

Thank you

---

<div class="post-metadata">

**Author:** ![PortableStick](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/portablestick/32/65591_2.png) [@PortableStick](https://forum.freecodecamp.org/u/PortableStick)\
**Post date:** [November 13, 2016, 3:59pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/2 "2016-11-13T15:59:59Z")

</div>

Do you have the project in an online project like CodePen that you can share?

The size setting `cover` will ensure that the entire background is covered by the image, even if it means clipping. If you want the full picture to be shown, use the setting `contain`.

---

<div class="post-metadata">

**Author:** ![MARKJ78](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/markj78/32/160083_2.png) [@MARKJ78](https://forum.freecodecamp.org/u/MARKJ78)\
**Post date:** [November 13, 2016, 4:01pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/3 "2016-11-13T16:01:25Z")

</div>

> **[Perfect Full Page Background Image | CSS-Tricks](https://css-tricks.com/perfect-full-page-background-image/)**
>
> Four techniques are explored on accomplishing a full page background image that conforms to our exceptions: no white space, scales as needed, retains aspect ratio, centered, and more.

---

<div class="post-metadata">

**Author:** ![Justinhed](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/justinhed/32/97419_2.png) [@Justinhed](https://forum.freecodecamp.org/u/Justinhed)\
**Post date:** [November 13, 2016, 4:29pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/4 "2016-11-13T16:29:49Z")

</div>

Yup thats where I got that code from… but does not seem to work…

---

<div class="post-metadata">

**Author:** ![MARKJ78](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/markj78/32/160083_2.png) [@MARKJ78](https://forum.freecodecamp.org/u/MARKJ78)\
**Post date:** [November 13, 2016, 4:34pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/5 "2016-11-13T16:34:33Z")

</div>

Have you checked there’s no other rules having an effect? Something like a fixed height on the container that makes it impossible to keep the aspect ratio without cropping the edges?

Also, you can do things like use the top value instead of the centre value. That will position your pic at the top but if the container is somehow fixed dimensions then it will also overflow, effectively cropping off what doesn’t fit from the bottom or sides.

---

<div class="post-metadata">

**Author:** ![MARKJ78](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/markj78/32/160083_2.png) [@MARKJ78](https://forum.freecodecamp.org/u/MARKJ78)\
**Post date:** [November 13, 2016, 4:54pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/6 "2016-11-13T16:54:10Z")

</div>

And also, your image is portrait orientation.

I assume your cover is 100% of the screen width? on wider screens that is going to cut loads of the top and bottom.

usually best to use an image with landscape orientation like [this](http://i.imgur.com/rrsm9mb.jpg)

---

<div class="post-metadata">

**Author:** ![Justinhed](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/justinhed/32/97419_2.png) [@Justinhed](https://forum.freecodecamp.org/u/Justinhed)\
**Post date:** [November 13, 2016, 5:17pm UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/7 "2016-11-13T17:17:20Z")

</div>

thanks for the help that Pic seems to work better.

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [January 16, 2021, 5:31am UTC](https://forum.freecodecamp.org/t/help-with-my-background-picture/54914/8 "2021-01-16T05:31:35Z")

</div>

Closed on January 16, 2021, 5:31am UTC


