# Ärgerliches CSS-Problem mit Hintergrundbild im Header

**URL:** https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204
**Category:** Support
**Created:** [2. Februar 2019 um 11:11 UTC](https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204 "2019-02-02T11:11:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MartyMeh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martymeh/32/113462_2.png) [@MartyMeh](https://meta.discourse.org/u/MartyMeh)
#### Post date: [2. Februar 2019 um 11:11 UTC](https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204/1 "2019-02-02T11:11:58Z")

</div>

I don’t tell you guys how much I love Discourse enough. I love Discourse. Thank you for creating it, always making it better, and offering great support 🙂

* * *

I added a background image, which I’m happy with. However, it’s behaving strangely in the header. When I scroll up to far you can see a second image poking it’s head out from behind, and just looking a little scrappy. Can anyone tell me how to fix this, I assume by removing it from the header section or something. Bear in mind I’m a luddite, so need some pretty clear instructions. Thanks!

 ![12%20pm](https://global.discourse-cdn.com/meta/original/3X/3/b/3b30c84d3f6866a5d31bda516fa14e2c323a90b6.jpeg)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [4. Februar 2019 um 00:15 UTC](https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204/2 "2019-02-04T00:15:18Z")

</div>

@Johani can you log on to the site and see if you can help out here?

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [4. Februar 2019 um 11:20 UTC](https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204/4 "2019-02-04T11:20:52Z")

</div>

The issue you’re seeing occurs because you’ve set a background on the `<html>` tag and gave it a position manually with the [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) property.

In the background component there’s a rule that looks like this:

```plaintext
html {
  background-position: 50% 30px;
}

```

This centers the background horizontally and pushes it down by `30px` vertically.

Since you didn’t set a [background-repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) property, it defaults to `repeat` which means that when you push the background-image by `30px` vertically, it will repeat itself in that space.

There are a couple of way to fix this, but I’ve opted for the simplest option.

I changed to background-position property in your theme from

```plaintext
html {
  background-position: 50% 30px;
}

```

to

```plaintext
html {
  background-position: center;
}

```

which should center the background and stop it from repeating and fix the issue on your site

[https://global.discourse-cdn.com/meta/original/3X/6/7/672df117569beb9f0a92f5b01569fbb55a3c4203.mp4](https://global.discourse-cdn.com/meta/original/3X/6/7/672df117569beb9f0a92f5b01569fbb55a3c4203.mp4)

---

<div class="post-metadata">

### Author: ![MartyMeh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martymeh/32/113462_2.png) [@MartyMeh](https://meta.discourse.org/u/MartyMeh)
#### Post date: [4. Februar 2019 um 21:42 UTC](https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204/5 "2019-02-04T21:42:35Z")

</div>

Ah, I see. I thought it was something to do with the header section. That makes more sense.

Thanks @Johani!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [6. März 2019 um 21:42 UTC](https://meta.discourse.org/t/annoying-css-issue-with-background-image-in-my-header/108204/6 "2019-03-06T21:42:49Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
