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 trialJohn Umbarila / Picture Perfect Properties
14,227 PointsI'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
John Umbarila / Picture Perfect Properties
14,227 PointsHi 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
Steve Hunter
57,712 PointsHi John,
I'll sort this tomorrow - I'll be back on the Community pages then.
Steve.
Steve Hunter
57,712 PointsWhat's in your CSS file - what's not showing up?
Steve.
3 Answers
Steve Hunter
57,712 PointsHi John,
Where is your code? Have you put it in the head
element of the html file?
Steve.
John Umbarila / Picture Perfect Properties
14,227 PointsSteve,
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
13,025 Pointsyou 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>
John Umbarila / Picture Perfect Properties
14,227 PointsHello Nestor,
Unfortunately, this did not resolve my issue.
Regards,
John
james brazil
2,582 PointsI 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">
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsHi 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.