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 trialMari Karlsnes
461 Pointsstyle.css wont upload to the html page
Trying to do this learning program and everything has been going fine until now. Suddenly all i do in style.css does not load up in the html file, so there i no changes on the site. Although it seems like I'm doing everything right.
Can anyone help me?
8 Answers
Anton Kalenik
4,639 Pointsshow your code
Mari Karlsnes
461 Pointsbody { font-family: 'Nunito', sans-serif ; color: #FAF3BC; background: #420600 url('img/bg-texture.jpg') repeat; }
a { color: #4FB69F; text-decoration: none; }
h1 { font-size: 1.750em; letter-spacing: -1.5px; }
h2 { font-size: 1.500em; color: #B4C34F; }
.btn { color: #FAF3BC; background: #4FB69F url('img/texture.png') no-repeat right top; padding: 15px 30px; margin: 40px 0px; border-radius: 25px; text-transform: uppercase; }
.btn:hover { background-color: #4CC4A7; }
Anton Kalenik
4,639 Pointsand your link tag too
Mari Karlsnes
461 Points<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
This one?
Anton Kalenik
4,639 Pointsremove "<" and ">" tags to display it here
Marcus Tisäter
4,886 PointsYou have to include the css file into you're HTML document to make it appear on you're website. You do this by typing in the HTML File under the <head> tag;
< link rel="stylesheet" type="text/css" href="style.css" >
Remember if you're style.css is not located in the same directory as the HTML file you have to PATH the href to the located directory were the css files is.
Anton Kalenik
4,639 Pointsyour css works correctly: http://cdpn.io/Lszma
does your style.css lie in the same directory as an index.html?
Paris Hunter
1,027 PointsIf that doesn't work, I just stumbled upon a boneheaded move on my part. If you are using Sublime like in the video, make sure to save the file name as STYLE.CSS and don't just select .CSS from the file type drop down menu. If you do it this way (.CSS from the dropdown menu ), it would work the first couple of times but when I looked in my directory, style.css was considered a 'file'. Another giveaway is if you are using Sublime, all of the code would be colored differently depending on the selectors and etc used. I hope I am explaining this right.
TL;DR - make sure in your folder directory, style is considered a .css file and not just a 'file'
Jonathan Loiacono
1,078 PointsJonathan Loiacono
1,078 PointsI am having a similar issue...When I save the file it works for about one refresh, then proceeds to not take any of the new additions I make after that (even after I save the new additions). I have my file saved in the css directory next to normalize.css and grid.css.
Any Ideas why this may be the case?
Here is my link to my style sheet. <link rel="stylesheet" type="text/css" href="css/style.css" media="screen">
Thanks!