How to Fix your Code

A Checklist.

Basics

  • Have you saved both files?
  • Have you refreshed the browser?

Now, the harder stuff: 

  • Are your files in the exact same directory on your hard drive? Are you sure?
  • Are you actually viewing those files in Brackets, or is it perhaps a file with the same name located elsewhere? Are either of your documents actually on a server?
  • Have you made multiple copies of this project, and if so, are you sure you’re working on the right version?

Now, the HTML stuff:

  • Is your HTML to link to the stylesheet inside the <head>? Does it look like this:
<link rel=“stylesheet” type=“text/css” href=“stylesheet.css”>
  • Where the code indicates the name of your stylesheet, are you certain that’s the exact name? Are there any capital letters or spaces?
  • When you look at that line of code, does it appear to be color-coded correctly by Brackets? Are there any unclosed tags or typos above the line of code not working? 
  • Do you have any duplicates of code that are only meant to appear once? What about duplicate closing tags, or none at all? 
  • Are you certain that the names of the tags you used in your HTML document align with the ones you used in your CSS document?

Now, the CSS stuff:

  • Is there anything in your CSS file that isn’t CSS? Like having a <style> HTML tag at the top of the document? That’d zap the whole doc. 
  • If you have a major error anywhere in your CSS, it’ll zap all the code below it. In ideal circumstances, you will notice the color coding changes and seems odd at some point in your document – look just above that. The most common errors are forgotten {curly brackets} and semi-colons; look for those.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.