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 CSS Foundations Selectors Type Selectors

John Umbarila / Picture Perfect Properties
John Umbarila / Picture Perfect Properties
14,227 Points

I'm at my wit's end with trying to link my HTML to my CSS. Please help

I've tried everything to no avail. Below is my code and file path to both files:

Code:

<link rel="stylesheet" href="css/style.css">

HTML file path: Users/JohnUmbarilaMAC/Downloads/selectors/type-selectors/start/index.html

CSS file path: Users/JohnUmbarilaMAC/Downloads/selectors/type-selectors/start/css/style.css

Thank you,

John

Hi John,

I got an email saying you had left a comment containing your HTML code for this but the web page doesn't seem to show me that. Odd!

Happy to help if you post it again.

Steve.

John Umbarila / Picture Perfect Properties
John Umbarila / Picture Perfect Properties
14,227 Points

Hi Steve,

Sorry, the code was appearing differently once I hit the "post comment" button so I deleted the comment. I'll try again. The rest of my code can be seen below:

<head>
    <title>CSS Selectors</title>
    <link rel="stylesheet" href="css/style.css">
</head>

For some reason the head tag won't show but the opening head tag is before my title tag and my closing head tag is after the link tag. Thanks

Hi John,

I'll sort this tomorrow - I'll be back on the Community pages then.

Steve.

What's in your CSS file - what's not showing up?

Steve.

3 Answers

Hi John,

Where is your code? Have you put it in the head element of the html file?

Steve.

John Umbarila / Picture Perfect Properties
John Umbarila / Picture Perfect Properties
14,227 Points

Steve,

You pointed me in the right direction! After asking about my CSS file, I noticed I was missing a semi colon in my CSS. Problem solved! Thank you, I appreciate your help!!!

Best Regards,

John

Nestor Segura
Nestor Segura
13,025 Points

you need also to write type="text/css"... so your code should be on the head of your html file like this

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

I know this may be a little too late, but i use brackets as my text editor (btw, their live preview is awesome) and i have to omit the "css/"

<link rel="stylesheet" href="style.css">