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

CSS How to Make a Website Debugging HTML and CSS Problems Use Developer Tools

Problem with reading CSS pages

My browsers (Internet Explorer & Google Chrome) either cannot read or recognize the CSS webpages of the website created as a project for the Treehouse Introductory Webpage course! Their styling instructions are NOT being applied. They can read the .html pages. What gives??

Darren Joy
Darren Joy
19,573 Points

Probably need more info to help you solve this.

From your question it appears you are not using WorkSpace but trying to open the pages as files with your browser?

Or are you previewing it in WorkSpace and it's opening because of that?

12 Answers

You're misreading what I said.

You have a typo in your code. It's suppose to be "rel" which stands for "relation" but you're using "ref". Also you're missing the type attribute which tells the document what type of file it is.

<link rel="stylesheet" type="text/css" href="yourcss.css">

<link ref="stylesheet" href="css/normalize.css"> <link href="http://fonts.googleapis.com/css?family=Changa+One:400,400italic" rel="stylesheet" type="text/css"> <link ref="stylesheet" href="css/main.css"> <link ref="stylesheet" href="css/responsive.css">

The directory structure is:

folder css file main (css document, .suffix is .css) file normalize (css document) file responsive (css document) folder img file about file contact file index

You have a typo. It's "rel" not "ref".

<link  rel="stylesheet" href="css/main.css">
<link  rel="stylesheet" href="css/responsive.css">

Missed one! The complete list:

<link ref="stylesheet" href="css/normalize.css"> <link href="http://fonts.googleapis.com/css?family=Changa+One:400,400italic" rel="stylesheet" type="text/css"> <link ref="stylesheet" href="css/main.css"> <link ref="stylesheet" href="css/responsive.css">

Can you elaborate more?

I ask this because browsers don't read CSS files; they just apply the styling to your html pages. If you open a CSS or JS file in the browser you're only going to see plain text.

I have removed the webpages from Workspaces ENTIRELY and am trying to run them as a stand alone web site on the browsers. I am presuming the html pages will access the css pages to do their stuff--sort of like a program reading an external file.

Darren Joy
Darren Joy
19,573 Points

They should, but check that the path to the CSS file in your HTML document is pointing to wherever you are now storing the CSS file rather than what was presented in the course material...

Yeah, they do access the CSS files but it depends on how your folder is set up. Could you paste the head section of your HTML file and describe how you have your folder set up?

the CSS folder contains files main, normalize, and responsive. All are CSS documents with the .css suffix (which is present but not shown)

Refer to my answer above. There's a small typo in the way you link to your css.

<head> <! comment > <meta charset="utf-8"> <title>Designer's Name | Occupation</title> <link ref="stylesheet" href="css/normalize.css"> <link href="http://fonts.googleapis.com/css?family=Changa+One:400,400italic" ref="stylesheet" type="text/css"> <link ref="stylesheet" href="css/main.css"> <link ref="stylesheet" href="css/responsive.css"> <meta name="viewpoint" content="width=device-width, initial-scale=1.0"> </head>

I cannot explain the 'rel' but they are NOT in my code! The above is what is truly there. I just checked and pasted it again! And, is the FONT link supposed to use single quotes? That is how it is on the Google.com/font website?

Thanks very much! That solved one problem and caused another! But such is my worry! Your help was appreciated!

No prob.