Title: Making a Category background fixed?
Last modified: August 20, 2016

---

# Making a Category background fixed?

 *  [thesimling](https://wordpress.org/support/users/thesimling/)
 * (@thesimling)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/)
 * At the moment I have this piece of code…
 * `body.category-generation1 { background:url(10.jpg)!important; }`
 * I tried putting background-fixed in below it, but it doesn’t work – can anyone
   help? Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [Alex](https://wordpress.org/support/users/alexdemchak/)
 * (@alexdemchak)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472376)
 * `body.category-generation1 { background:url(10.jpg) fixed !important; }`
 * That should work – the old way of doing things was
 * div { background-color: foobar;
    background-position: foobar; background-image:
   foobar; }
 * etc, but thanks to shorthand properties you can combine them all on one line
   
   div { background: #fff url(x.jpg) fixed; }
 * Hope this works 🙂
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472377)
 * Other than css, maybe something like this in your category template? I use it
   to show category title images but maybe you could adapt to your purpose..? Although
   if the css solution above works, is probably best.
 *     ```
       <?php if (is_category('news')) { ?>
       	<h2 class="cat-title"> 
   
       <img 
   
       src="http://foursticks.net/harborsmu
   
       sic/wp-includes/images/news.jpg">
       </h2> 
   
       <?php } ?>
   
       <?php if (is_category('shows')) { ?>
       	<h2 class="cat-title"> 
   
       <img 
   
       src="http://foursticks.net/harborsmu
   
       sic/wp-includes/images/shows.jpg">
       </h2>
   
       <?php } ?>
       ```
   
 *  Thread Starter [thesimling](https://wordpress.org/support/users/thesimling/)
 * (@thesimling)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472432)
 * Sadly, it’s not working… [this is the blog in question.](http://www.burnettlegacy.simmin24.co.uk/wordpress/?p=10)
   As you can see, even with the updated CSS it doesn’t work and the background “
   moves.”
 * I’m not very experienced so I can’t write code or really figure it out, does 
   anyone have any-more ideas.
 *  Thread Starter [thesimling](https://wordpress.org/support/users/thesimling/)
 * (@thesimling)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472438)
 * Sorry, but I had to add…
 * What if you tried to tell me what the full code would be for the old way of doing
   it (I don’t know what to put)? Thanks.
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472453)
 * Oh my, this is the first time I’ve seen it, are you sure you’re not talking about
   the content area? it moves, the background is fixed.
    Now it looks like you need
   a transparent content area?
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472454)
 * Sorry if I was diverted by the category-background reference, perhaps this is
   what you are trying to do, the opposite of what you may have thought:
 *     ```
       body.category-generation1 {
           background: url("10.jpg") repeat scroll 0 0 transparent !important;
       }
       ```
   
 * You want your background to scroll, it was already fixed and the content area
   was scrolling above it. This will make them scroll together.
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472455)
 * you can also do this:
 *     ```
       #wrapper {
           background: none repeat fixed 0 0 transparent;
           margin-top: 20px;
           padding: 0 20px;
       }
       ```
   
 * or this
 *     ```
       #wrapper {
           background: none repeat fixed 0 0 transparent;
           margin-top: 20px;
           padding: 0 20px;
       }
       ```
   
 * or this:
 *     ```
       body.category-generation1 {
           background: url("10.jpg") repeat fixed 0 0 transparent !important;
       }
       ```
   
 * play around!
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472456)
 * this is cool too: opacity, can be fixed or scroll:
 *     ```
       #wrapper {
           background: none repeat scroll 0 0 #FFFFFF;
           margin-top: 20px;
           opacity: 0.6;
           padding: 0 20px;
       }
       ```
   
 * but you’d have to make fonts darker.
 *  Thread Starter [thesimling](https://wordpress.org/support/users/thesimling/)
 * (@thesimling)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472466)
 * I was going to ask about changing the opacity of the content area… ideally I 
   would like a black transparent background (and knowledge on how to change all
   of the font colours)? That would be good! 🙂
 * UGH, just refreshed my browser. All it needed was a simple refresh to get the
   background fixed!!! 😀
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472467)
 * > ideally I would like a black transparent background
 * Do you mean black opaque? also, are you talking about the background? there’s
   nothing behind it to show through, so I’m not sure why transparent? You must 
   mean the content area? just change the color in the code I provided, you can 
   also adjust opacity, higher number is less transparent.
 *     ```
       #wrapper {
           background: none repeat scroll 0 0 #000000;
           margin-top: 20px;
           opacity: 0.6;
           padding: 0 20px;
       }
       ```
   
 * “All the font colors” wil have to be dealt with one at a time.
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472468)
 * hmmm, actually somethings not right with this, ideally the background of the 
   content area should be opaque without effecting the content opacity. As it stands
   your content will be semi transparent, not good. I’ll have to poke around more.
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472471)
 * Okay, this coding is more complicated than I thought. after reading up on it,
   the prefered way to get opacity is with an opaque .png image set as the image
   for your container. I’d definately concider that route.
    If you don’t have the
   means to do that I could send you one, it’s easier than any support I give on
   this forum, so no problem. Problem is i can’t see a way to show my email in my
   profile, and we’re not supposed to post them in the forum..?
 *  [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * (@deepbevel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472475)
 * turns out you just have to click my user name, or so I’m told.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Making a Category background fixed?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 3 participants
 * Last reply from: [deepbevel](https://wordpress.org/support/users/deepbevel/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/making-a-category-background-fixed/#post-2472475)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
