Applying css stylesheet to html file in a browser


#1

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.
Thanks.


#2

Hey,

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


#3

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


#4

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

What inspired you to learn programming ?
Join the discussion


#5

@dex6921,
Here some pointers.....

google search
== the Book ==
jquery [your question] site:developer.mozilla.org
CSS [your question] site:developer.mozilla.org
javascript [your question] site:developer.mozilla.org
[your question] site:jquery.com
[your question] site:getbootstrap.com

== discussions / opinions ==
jquery [your question] site:stackoverflow.com
CSS [your question] site:stackoverflow.com
javascript [your question] site:stackoverflow.com

== guidance ==
www.crockford.com
[your question] site:crockford.com
- - http://javascript.crockford.com/code.html
- - http://javascript.crockford.com/survey.html

http://stackoverflow.com/questions/1795438/load-and-execution-sequence-of-a-web-page
http://www.w3schools.com/jquery/trysel.asp