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 Introduction to HTML and CSS (2016) HTML: The Structural Foundation of Web Pages and Applications Image Tags

andrew Schoenherr
PLUS
andrew Schoenherr
Courses Plus Student 704 Points

CSS not working on local

Hi,

I have copied and pasted the code from the lesson to my local machine. Unless I am over looking it the file system is correctly ordered, file names are correct, however the css is not working in my browser. I understand Images unless replaced would not be there but no back ground colors or any basic styles are showing. What am I missing?

Steven Parker
Steven Parker
230,995 Points

If some styles are showing then clearly the file is being accessed. But there may be an internal problem in the code itself. If you'd like someone to check it, please show the files here (with code formatting).

2 Answers

Steven Parker
Steven Parker
230,995 Points

When you say "to my local machine", do you mean you are running a server on your machine? Check both the location and access permissions by loading the CSS file directly in your browser by adding it's path to the URL of the page that uses it.

andrew Schoenherr
andrew Schoenherr
Courses Plus Student 704 Points

as per "my local machine" I mean my editior and folder on my computer.

andrew Schoenherr
andrew Schoenherr
Courses Plus Student 704 Points

<head> <meta charset="utf-8"> <title>Andy Schoenherr Profile</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <link href="https://fonts.googleapis.com/css?family=Muli%7CRoboto:400,300,500,700,900" rel="stylesheet"></head>

Steven Parker
Steven Parker
230,995 Points

What kind of editor? Are you sure the editor has the ability to read and process external CSS files and display the results?

And the file is named "styles.css" and located in the same folder as the HTML file?

andrew Schoenherr
andrew Schoenherr
Courses Plus Student 704 Points

Yes, yes and yes. I'm using sublime text. I have been for 3 years. I have never had an issue with the editor. It's something I'm missing. Part of the styles are showing others aren't. In the lesson there is a header bar with her name on the left and a very on the right. On mine, no header bar and mac is a list. Bullets are running up and down the left side. And links are colored although there is decoration set to none. I don't have her images so I get that. I can change background color in the CSS and it works. But it all looks broken. So there is something I'm over looking.

Hi there,

is your css file included in your html file ?

andrew Schoenherr
andrew Schoenherr
Courses Plus Student 704 Points

yes,

<head> <meta charset="utf-8"> <title>Andy Schoenherr Profile</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="styles.css"> <link href="https://fonts.googleapis.com/css?family=Muli%7CRoboto:400,300,500,700,900" rel="stylesheet"></head>