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

unable to link style sheet even after providing perfect path

I have created my own style and HTML sheet for practise based on my fav.show:HIMYM; I am unable to link my style sheet with HTML. Path is perfect. My link statement: <link href=“CSS/style.css” rel=“stylesheet”>

my style sheet: html{ background:#483D8B; }

body{ margin: 0 auto; max-width: 800px; }

img { width: 100%; }

.barney { display:block; margin: 300px 0 100px 0; padding: 0; }

.lilly { display:block; margin: 250 px 0 50px 0; padding: 0; }

a { background: transparent; border: 0; display: block; float: left; margin: 0; outline: 0; padding: 0; width: 33%; }

To add on I'am not able to see even my images

Kindly take time to answer!

Thanks

4 Answers

on line 7 you had your href and link ref reversed. change it to this:

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

as far as your pictures go, i just redid the line and got them to populate :

<img src="pics/bs.png" class="barney" alt="bs">
<img src="pics/lilly.png" class="lilly" alt="lilly">

all seems to be working with these changes

Nope! Same problem continues! No pics to popup and style sheet not getting linked

it works on my system. what are you using as an editor ?

System: Mac Editor: TextEdit

what about u??

I am using Komodo Edit on a Mac ..(its free)

try to avoid Text Based Editors unless they do syntax highlighting. or a designed for coding. they can introduce hidden things that cause problems.

https://www.dropbox.com/sh/lij6e0m4uiyagcr/AABkig0dvChspkv5tf2TPzyga?dl=0

here are the revised changes give it a try. Its working fine on my side

works like a charm! thanks James!

make sure to double check your case sensitivity. I see you have CSS/style.css in CAPS. make sure the folder path is named exactly as the folder. relative paths are case sensitive!

"Check" The folder name is in CAPS! still unable to do it

can you provide a link to where this is stored ? either in a workspace or live on the web ??

Here is a drobbox link:

https://dl.dropboxusercontent.com/u/84859355/HTML%20and%20CSS.zip

Thanks for your effort James

have you tried

<link href=“./CSS/style.css” rel=“stylesheet”>

or

<link href=“/CSS/style.css” rel=“stylesheet”>

I did after your suggestion! doesn't help!!