Title: CSS codes aren&#039;t working&#8230;
Last modified: August 19, 2016

---

# CSS codes aren't working…

 *  Resolved [tnd](https://wordpress.org/support/users/tntag/)
 * (@tntag)
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/)
 * I recently took a few tutorials on CSS, and have been using them to add designs
   to my WordPress-powered website. For some reason, though, the CSS code for adding
   a background isn’t working. I’ve been using the following code, copy-and-pasted
   from a tutorial (as I said, it has worked before):
 *     ```
       <head>
       <style type="text/css">
       body{background-image:url('[imagename.filetype]');}
       </style>
       </head>
       ```
   
 * I’ve tried testing it multiple times, in different places, and with different
   filetypes. It’s starting to get very frustrating. Any suggestions?

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076572)
 * what have you replaced this `[imagename.filetype]` with in your real code?
 * i.e. this has to point to an existing image;
 * within wordpress templates (different from when the style is used in style.css)
   you would need to use the absolute path to the image, facilitated with the use
   of ‘bloginfo()’ function:
    [http://codex.wordpress.org/Function_Reference/bloginfo](http://codex.wordpress.org/Function_Reference/bloginfo)
 * example:
 *     ```
       <head>
       <style type="text/css">
       body{background-image:url('<?php bloginfo('stylesheet_directory'); ?>/images/logo-image.jpg');}
       </style>
       </head>
       ```
   
 * assuming that the image is called logo-image.jpg and is located in the /images
   folder of the theme.
 *  Thread Starter [tnd](https://wordpress.org/support/users/tntag/)
 * (@tntag)
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076577)
 * Thanks for replying so quickly.
    I have used this code a few times on another
   website-builder, and it worked fine. I used filenames of images on my computer(
   one was `websitebackground3.jpg`). So if I wanted to use one of these images 
   on WordPress, I would have to upload it to the directory? Also, I tested the 
   code today on W3Schools, where it had worked before, and it does nothing now.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076582)
 * > So if I wanted to use one of these images on WordPress, I would have to upload
   > it to the directory?
 * Yes.
 * We can’t speak for this ‘other’ website builder, but basically if your image 
   isn’t on your webserver, WordPress cannot see it.
 *  Thread Starter [tnd](https://wordpress.org/support/users/tntag/)
 * (@tntag)
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076584)
 * > We can’t speak for this ‘other’ website builder, but basically if your image
   > isn’t on your webserver, WordPress cannot see it.
 * Ah, that does make sense…guess I was having a blond moment, haha.
    Thank you 
   very, very much. You guys have been a big help!
 *  Thread Starter [tnd](https://wordpress.org/support/users/tntag/)
 * (@tntag)
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076587)
 * One last question: I’m not entirely sure _where_ to put in the directory.
 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076590)
 * wp-content/themes/YOURTHEME/images 🙂
 *  Thread Starter [tnd](https://wordpress.org/support/users/tntag/)
 * (@tntag)
 * [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076592)
 * Alright, thanks!

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

The topic ‘CSS codes aren't working…’ is closed to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [css](https://wordpress.org/support/topic-tag/css/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [tnd](https://wordpress.org/support/users/tntag/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/css-codes-arent-working/#post-2076592)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
