• I am very new to this, so this might be a really stupid question, but I am having trouble with creating a repeating background, on the top of my page, along the x-axis.

    I am using the following code:

    body {background: url(/wp-content/themes/blank/images/body-bg.png) top center repeat-x white;}

    I am following along with one of the tutorials on WordPress from CSS-Tricks and it seems like it should work. I did everything that Chris Coyier did in his own video, and yet when I load my index.php file, the background does not appear. Then, when I right-click on the window and say “View Background Image,” it gives me a 404 error saying that the URL /wp-content/themes/blank/images/body-bg.png was not found on the server.

    What am I doing wrong? And before you say anything, yes, the file path is correct, and yes, the file does exist in that folder. Help me!

    P.S. Also, I do not know if this makes a difference or not, but I am working locally on “localhost.” Thanks in advance!

Viewing 1 replies (of 1 total)
  • Thread Starter mwdewitt

    (@mwdewitt)

    I wrote a similar post on CSS-Tricks and someone was kind enough to help me. My problem stems from the URL I was referencing to. I am still getting used to the syntax used in HTML and PHP, and the individual who helped me, pointed out that I did not need to reference the entire string of files leading back to the “root” folder. They said “If ‘style.css’ is in the theme folder and the image is in an ‘images’ folder in the theme folder then:”

    body {background: url(./images/body-bg.png) top center repeat-x white}

    I simply just had to reference the “blank” themes folder. Simple as that. I knew it was a quick fix. I hope that this helps anyone else who may have this same problem.

Viewing 1 replies (of 1 total)

The topic ‘Problem With Repeating Background’ is closed to new replies.