www.wd4e.com

Code Placement

When you write code, it is important to get into the good habits of organizing your code. While there are no specific rules about how and where to place your code, there are definitely conventions. (Conventions are suggestions that most programmers follow. This way other programmers can quickly and easily understand their code.)

The most common organization is to have one main folder with your html files in it. There are also subfolders (folders inside the main folder) for your CSS files and image files. (In this example I also have JavaScript files.)



When we use CodePen we use that idea of separating our code. However, be aware that CodePen doesn't require many of the things you should have in your code. For instance, in the HTML files it ignores all of the information in the section. So if you develop in CodePen, make sure to test your code later using the proper folder/file structure. You will need to include links to the style sheets and images.

It can be very frustrating at first to master folder. However, understanding folder structures will help you, even if you never code again.

I am going to end with a screen shot of my computer.



My css folder is in the SAME directory as my html files.

My link will be:

It is important that you even use the proper case. Because on some computers it matters and this would not work: