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
Matthew Clark
7,255 PointsHow do I make a photo stretch behind the html document?
How do I make a photo stretch behind the html document?
1 Answer
Aurelien Schlumberger
6,127 PointsYou can use CSS to add styles.
Your html will probably will look something like that
<html>
<body>
<p>Hello world!</p>
</body>
</html>
If you want to add the image as a background you can use the CSS background attribute. Inline:
<body style="background:url(../myimagespaths/myimage.jpg) 0 0 no-repeat;>
Note: "html 0 0 no-repeat" are positional options of the image (top left in this case) and if you want the image to repeat itself.
If you have a linked CSS file to your html, in your css file you can also write:
body {
background:url(../myimagespath/myimage.extension) 0 0 no-repeat
}
Hope it helps