Problem linking to Css file

Hi. I don’t know if this is the right place to ask this. If it is the wrong place, my apologies. But I have a problem and I hope someone can help me.

So I am using Notepad++ to write a code. I made 2 new files . The one I am writing my HTML in. The other I want to use for CSS. So both files are in the same folder. I saved them as HTML and CSS files. Now I tried to link the HTML with the CSS file but when I load the code in Chrome the styling does not show. I used the link element with the “rel” attribute and the href set to “styles.css”
But it still won’t show up. I tried many more things and names and href’s but it still won’t show. Please help me someone if you can. Thank you very much.
Have a good day.

Hi and welcome to the community!
Can you share your code here so we can better assist you?

You want me to add the whole code here?

Just the part where you’re linking to the css file can be enough. The head element for example.

Thank you for the welcome by the way. Appreciate it .

1 Like

Oh ok. Give me a second. Be right there.

Cafe Menu

So that’s the code. The href is a different thing to what I said it was but I was trying anything I could that I thought might work.

Add the code between two sets of ```. Or you can add the code, select it and Ctrl + e. That will make it readable for us.

<head>
<meta charset="utf-8">
<Title>Cafe Menu</Title> 
<link rel="stylesheet" type="text/css" href="new2.css">
</head>

Cool!!!
Didn’t know you can do that.

1 Like

This looks okay. Have you double checked the name of the css file? Do you have any styles in that file? Maybe try sharing your css code as well. You might have an error there.
Oh and also, the title element shouldn’t be capitalized. I don’t know if that causes the error, but better to write it in lowercase.

I see. Yeah I was on the fence about that but decided it won’t make trouble. But I’ll make it lowercase and send you the css code. it’s actually really small. Only one styling thing. I wanted to make sure it will work before adding more.

It’s working now. Maybe I didn’t refresh it but it is ok now. So I take it you don’t need to see the CSS. It was just a id type selector targeting the body element anyway.

But yeah it’s working now so thank you for your help.
I appreciate it.

Great job! I’m glad it’s working.
Good luck on the project!

Thank you. Best wishes to you as well.

1 Like