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
Gareth Powell
Courses Plus Student 7,016 PointsHelp with some CSS please
Hi Everyone,
I hope you can help me please.
I am struggling to get my code pass on this question from
"Build a Simple Website > Styling Content > Add the background texture.png from inside the img folder and set the background to repeat."
Here is my css:
/* Write your CSS below */ body { font-family: 'Nunito', sans-serif; color: #FAF3BC; background: #420600; background-image: url('img/texture.png') repeat; }
Here is my html:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Smells Like Bakin' Cupcake Company</title> <link href='//fonts.googleapis.com/css?family=Nunito' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="style.css" type="text/css" media="screen"> </head> <body> <div id="intro"> <h1>Opposites really do attract, especially in our kitchen! We combine unexpected flavors that melt together to create ironically delicious desserts.</h1> <p><a href="#" class="btn">Browse Our Cupcakes</a></p> </div>
<div id="featured-cupcake"> <h2>Cupcake of the Week</h2> <p>This week’s featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavors will kick your taste buds into fiesta mode!</p> </div> </body> </html>
I've tried numerous variations but still can't get it. Its probably really obvious but any help will be much appreciated.
Thanks, Gareth
4 Answers
Hey Gareth,
I haven't actually done the task - I seem to remember typing out the repeat in a different way - for example:
background-image:url('img/texture.png'); background-repeat:repeat;
Hope that helps! Sam
James Barnett
39,199 PointsTwo things that can help get your question answered quicker:
- A link to the code challenge you are having issues with
- A "working" example of your code using codepen.io
Jonathan Peck
6,472 Pointstry this...
url('../img/texture.png')
I left out the forward slash before the image on a page of mine a couple of weeks ago..(couldn't figure out what was wrong)..I thought I had lost my mind.
Gareth Powell
Courses Plus Student 7,016 PointsThanks Everyone for quick and helpful responses!
It was Sammy's suggestion that got it to pass.
Much appreciated and Happy New Year!