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

How do I make add a background image to the header?

This is my css code...

header { background-image: image('falcon.jpg'); height: 650px; padding: 1px; margin: 1px; margin-bottom: 75px; }

3 Answers

Replace

image('falcon.jpg')

with

url('falcon.jpg');

I tried that in my text editor "Atom" and it did not work. Than I tried copying the code in to notepad and saving the document as an html file, and the code ran as it should. Apparently this is an issue in my editor... although Atom is a very popular code editor. What should I do?

did you try to update Atom

Not sure about the issue with atom, you can try to update or try the Beta version of atom if the problem persists: https://atom.io/beta

Other than that, I would recommend the text editors below:

https://www.sublimetext.com/

https://code.visualstudio.com/download

I completely forgot that I had to put the image into the same folder as the actual website. Thank you though!