Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Building a simple website - early CSS lesson.

Hello everyone!

I just started the web designer courses today and I'm having a slight problem that I can't figure out.

I'm trying to add a background texture to my website, the image file is in the correct location but it is refusing to do anything - instead I'm getting the hex colour. Please take a look at my code as I cannot see what I'm doing wrong.

body{
font-family: 'Nunito', sans-serif;
color: #FAF3BC;
background: #420600 url('img/bg-texture.jpg') repeat;
}

Thanks!

2 Answers

John Locke
John Locke
15,479 Points

Hi Mark:

Try putting a slash in front of your url path to your jpg. That indicates that it's starting at the root folder and working down the tree.

Hi John,

I figured it, lol! I thought I could use the same img folder for the the textures I was using in CSS as I was using for the HTML images. I now have funky textures, yay!