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 trial

HTML

Cory Sessums
Cory Sessums
4,634 Points

Having trouble linking files and css sheets.

Hello all. I am having trouble with the linking the files provided and making them appear on my intro webpage. It also appears that my css is not changing the form at all. Is there a way I should be setting my files up on my desktop or the like in order to have them easily available? The twitter and facebook logos appear without difficult.

Cory Sessums
Cory Sessums
4,634 Points

Also I cant seem to drag a screenshot here or it links me to a new browser window.

2 Answers

This is how I do it and so far that has worked wonderfully:

Create a folder somewhere and call it "MY_WEBPROJECTS" or something. This is the thing you collect everything that you build over the next 6 or 9 months in.

Then make a folder in there with your project name. Something like "FIRST_WEBSITE". That is were your "first_website" will live. In there you create a file called "index.html" and two folders called "CSS" and "JS".

Then you open the "CSS" folder and create a file called "style.css". and then you go into the "JS" folder and create a fil called "script.js".

Then when you open the "index.html" and put this code inside the <header> tag: <link rel="stylesheet" href="CSS/style.css">

And this code goes just before the end of the <body> tag: <script src="JS/script.js"></script>

In the end your code should look something like this:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="CSS/style.css">
</head>
<body>
    <header>
    </header>

    <section>
        <article>
        </article>
    </section>

    <footer>
    </footer>

    <script src="JS/script.js"></script>
</body>
</html>

This is what my HTML new file template looks like and everything else gets usually added to that.

Cory Sessums
Cory Sessums
4,634 Points

Awesome! Thanks a bunch. Problems solved.