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 trialandrew raymundo
2,953 Pointsadd in an image element withing the body
How do you add an image element within the folder named img ?
<!DOCTYPE html>
<html>
<head>
<title>The Moon</title>
</head>
<body img="../../moon.jpg">
</body>
</html>
Nemanja Blagojevič
2,650 PointsYou have used wrong tags.
Right way to do this is <body> <img src="../../someimg.jpg"> </body>
or just to select body in your CSS file and add rules body { background-image: url(' put here some URL '); }
Rafael silva
23,877 PointsRafael silva
23,877 PointsYou can do it using only css by add the background-imagem property example bellow.
body { background-image: url('img/someimage.jpg'); background-repeat: no-repeat; background-size: cover; background-position: center; }