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 trialLuke Munoz
591 PointsCSS link to HTML
Simple problem; difficult solution!
I apologize if this is a dumb question but I cannot get my CSS file to link to my HTML document. ****HTML CODE**** <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Luke Munoz | Designer</title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <header>
******CSS CODE******* a { text-decoration: none; }
My CSS file will not make the change to the underlines. I also tried changing the background-color as well and no go. Just to make sure, I embedded the code in my index file and it worked so somehow my CSS and HTML are not linked but I cannot figure it out. This seems so easy. Please help.
5 Answers
Luke Munoz
591 PointsFirst of all thanks for replying. Okay... So both my normalize.css and main.css files are inside the css folder. I am using firefox and cleared the cache: didn't work. Then I cleared the cache in chrome and tried it there: didn't work.
Also, how do I know if my normalize.css link is working? I copied and pasted the code from github into my normalize.css file.
jcorum
71,830 PointsTo check whether normalize.css is working try the page with and then without that link element. You should see quite a difference, in any browser.
Luke Munoz
591 PointsOkay, I tried that and there was no change in my browser. I have double checked my links in HTML and the spelling and location and nothing seems to working.
Thomas the Tank Engine
12,107 PointsHmmm...
Puzzling. The only thing I can think of is to double check the folder structure. Make sure the HTML file is one level above the css folder.
rootFolder
|-- index.html
|-- css
|--normalize.css
|--main.css
Luke Munoz
591 PointsArrrrgh... I figured it out. one of the "s" letters in my folder name was capitalized. What an oversight! Problem solved. I learned a lot about normalize though. Thanks everyone!
jcorum
71,830 Pointsjcorum
71,830 PointsLuke, first question: Is your html normalized? I.e., is the link to normalize.css working? If so, then second question: Are you sure that main.css is in the css folder? If so, then you might try clearing the cache in your browser. Sometimes browsers don't think changes in css files are changes, and so they reload an old file.