Sublime Forum

HTML not linking to the CSS

#1

I have read the forum and have seen many people asking this question. When I try to link the CSS to the HTML it just doesn’t do it. I am using a Mac. I have the two files in the same folder so it is not a path error (I have seen that many people have suggested that as the answer to the issue, but I can assure you it is not), and when I use any other editor to open the HTML it reads the CSS just fine.

Is this a known issue? please advise.

Thanks,

Cesar

0 Likes

#2

Sorry if it sounds a dumb question but:
what do you mean by “html not linking to the css”? supposing to talk about editor’s features, what actions/behaviours do you expect from ST when you open an html file (I’m asking because you did mention opening html in “other editors”)?

0 Likes

#3

Oh no, it’s a good question actually. After sending it I felt like I should have included more details. When I write the following:

In the index.html file:

CSS not working

Hello World!

And then the style.css file is:

body {
background-color: blue;
}

When I open the .html file in safari (or chrome) I see “Hello World!” with a white (not blue) background. Both files are in the same folder.

0 Likes

#4

Anybody?

0 Likes

#5

ST doesn’t link style sheets to html, the browser does through the markup you provide. It seems that there is an issue with how the files are being served to the browser.

0 Likes

#6

I can’t replicate the error you’re seeing, but the body end tag is missing in your HTML, which might be the cause.

0 Likes

#7

Is that a known issue? any way around it? I haven’t been able to work from the mac and it’s be awesome to have a workaround.

Edit: I just read your post correctly. When I do it with any other editor it works fine so I’m not sure if it’s that.

Oops! I just wrote that in the forum as a way of simplifying the issue but all the end tags are properly coded in the actual file (I had to double check as I made that mistake here). Are you using PC or MAC? If you are using PC and cannot replicate the problem then it might be a MAC only issue.

Thanks for the replies! I hope I can get to the bottom of this.

0 Likes