Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Cannot include CSS File with sublime

For some reason I cannot include CSS File, I checked every single line even copied the entire lines from the project file, but I cannot get the css file to work. The only way I can get it opened is when I open it with wordpad, copy and paste the project file. anyone else experienced the same? I cannot find out why I can't make it work even after copying and pasting the lines in sublime.

<!DOCTYPE html>
<html>
<head>
    <title>Adding CSS</title>
    <link rel="stylesheet" href="css/style.css">
    <style type="text/css">
        h1 {
            color: white;
            background-color: #E14607;
        }
    </style>
</head>
<body style="background-color: #BDD4DE;">
    <h1>Adding CSS to the Page!</h1>

    <h2>Lorem ipsum dolor sit amet</h2>
    <ul>
        <li>Praesent sem ligula rhoncus</li>
        <li>Donec ut ipsum at quam</li>
        <li>Maecenas libero neque accumsan ut</li>
        <li>Donec quis mauris ipsum</li>
    </ul>
</body>
</html>

Under CSS Folder

h2 {
    color: steelblue;
    padding-bottom: 10px;
    border-bottom: 2px dotted;
}

ul {
    color: #FFF;
    background-color: steelblue;
}

4 Answers

James Barnett
James Barnett
39,199 Points

To help us better help you we need to see the code you are using. For some tips on how to do that, check out the tips for asking questions video located in the right hand sidebar.

thanks, I didn't post it as I thought it was sublime issue, but I've posted what I have now.

Confusing. Can you post your folder / file structure? Additionally, open Chrome developer tools and inspect what code is running. It can point out what it is doing and help guide you.

Adam Greenough
Adam Greenough
7,742 Points

View the page source of index.html. Style.css should be a hyperlink (in Chrome at least). Clicking that link should take you to your CSS file, yes/no?

Thank you for the suggestions! Just checked with Chrome, and was working fine. The issue occurred only on IE.