Applying css stylesheet to html file in a browser

I have written a html fie in my editor (.html) and also made another file which is my style sheet (.css). I have placed the [link="text/css… code ]in the html file and named my stylsheet.
I opened my html file in the browser, but how do I apply the .css file to it?
Probably a basic question, but new to this so have no idea.
Hope someone can help me out.


In your head tags you need to link your CSS in using the link tag
like so:

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

On you pc make sure your HTML and CSS file is in the same file/location

Thank you. IYour answer made me recheck my link code and I discovered I had placed a + instead of an =. Thank you!

Np, You’re welcome
Happy Learning :slightly_smiling:
Happy coding !

What inspired you to learn programming ?
Join the discussion

Here some pointers…

google search
== the Book ==
jquery [your question]
CSS [your question]
javascript [your question]
[your question]
[your question]

== discussions / opinions ==
jquery [your question]
CSS [your question]
javascript [your question]

== guidance ==
[your question]