Hi guys!

Need some assistance please. I’m learning and building at the same time. I am struggling to link my CSS file to my HTML file. I have used the following code:

But it won’t work. Clearly I am doing something wrong.

I am coding using Sublime Text, and have created and saved the website file with both HTML and CSS files together.

What am I missing?

Thanks :slight_smile:

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


is your css file named main, is it a css file and in the same folder as the html file?

if the answer to all these 3 questions is yes, please upload the files (dropbox, google drive, whatever you prefer) and share the files here on the forum. Then i can have a look


To be honest I am a bit hesitant to share my file, I’m building something unique… could it be that I’m previewing the file on Safari and should use Chrome instead?


Yes to all three questions


File is called: main.css
I saved into the same folder with the the HTML pages on my desktop.


then please share the directory with me so i can have a look, its the only way i can help you

If you want to keep your html source code a secret, you can never publish (go live) with your website. Code of html & css of a website can be viewed


Not worried about the code just what the code makes :wink: But I will share it cause I’m getting frustrated and can’t continue my learning or building.

How do I share the directory exactly, Stetim94?


the entire html source code can be viewed, all of it.

the forum this not support this, you will need to use an external cloud service like google drive, dropbox or whatever tool you know/feel comfortable with


I understand. I’m sure it will be safe.

I will be honest this may seem naive but I wouldn’t know where to even begin. I would prefer to use google drive, how would I create this file on google drive, then where do I sent it to? via email. Please help.


you can go to google drive:

then in the left corner select: new -> upload folder (not sure what it says, mine is not set to english). Once the folder is uploaded, i think you need to right click the directory to share it.

But as a programmer, figuring out google drive shouldn’t be a problem


Very simple, thank you. Will await your response.

Appreciate the help.


the css file is empty? Once i add css code to the file, it works fine?

one tip, i would avoid inserting spaces in your file names, use underscores instead of spaces.


Thank you for the tip. Sorry I was in meeting. I have corrected the CSS file and see my error. Thank you for your help.

Have a great day/evening further


Just a final question, if I wanted a specific color for CSS, its a different shade of orange. How would I get the Hexadecimal color code or RGB color code.

Thanks again


have you you updated the same folder on google drive? The css file still looks empty


No need to update it, I have found the error.


just a mistake in the css file? So all good now?


Can I ask another unrelated question to the CSS one? it has to do with linking?


sure, what is your question?