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 trialJames Strickland
246 PointsMain.css will not load . .
This is what's in index.html:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Jim Strickland | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head>
This is what's in main.css:
a { text-decoration: none; }
When I run index.html main.css has no effect? Could anyone offer a suggestion?
8 Answers
Preston Skaggs
11,818 PointsMake sure your file path is correct. Is "css/main.css" correct? Did you place the main.css file in a folder titled "css"? If not changed the file path to "main.css".
Niclas Valentiner
8,947 PointsRemember to add the type to your links. type="text/css"
Kevin Sulonen
Courses Plus Student 12,856 PointsI think Preston's got it right. Make sure "main.css" is actually in your "css" folder. You can double check this by changing
<link rel="stylesheet" href="css/main.css">
to
<link rel="stylesheet" href="main.css">
If it works, I bet you didn't move your "main.css" into the "css" folder.
Also, one thing I always forget to do is to save my files. If you're using Treehouse's workspace for writing this, make sure there isn't a colored dot after the filename on the top tab. ...now I see that erdrag already mentioned this!
Another question: do you have this stuff in your
<head></head>
section?
Steve N. Peralta R.
31,097 Pointsok, I'll notice that you've added here the Doctype too, and I guess thats the code you had on your index.html, right?. The question is: "Did U write that code into the HEAD tag?" I'm pretty sure u don't :P
Steve N. Peralta R.
31,097 Points <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jim Strickland | Designer</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<!-- try it -->
</body>
</html>
However if u put the main.css on css folder it's ok, remember that the index must be on the root path. Try it locally too
James Strickland
246 Pointsmain.css was saved, main.css is located in the css folder. I coded this: <link rel="stylesheet" href="css/main2.css"> for the purpose of troubleshooting.
main2.css doesn't really exist, I just made up the filename and I get no error because of this. That tells me that HTML isn't executing that line of code. This has me baffled. I'm at the end of my troubleshooting ideas. Any other conclusions?
Kevin Sulonen
Courses Plus Student 12,856 PointsSorry you're having problems, James. Can I ask you this? What are you expecting this rule to do for you? Just to remove the underline from all
<a href="something">
anchor elements, right?
James Strickland
246 PointsRight. Remove underlines from anchor elements.
Kevin Sulonen
Courses Plus Student 12,856 Pointstry it with a:link?
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 PointsAlso, check so you have saved the file after writing new code! :)