[web] Linking Style Sheets to pages for re-use
I am trying to make a page for me and some friends. I have a little experience with HTML but here recently I have been trying to learn how to use CSS with my pages. I have been using a website to help me along with this, but it doesn't seem to have anything else on how to link a CSS to your page.
I was using a line of code to link the page that looked like this:
<link rel=stylesheet href:"www.mywebsite.com/directory/subdirectory/textfile.css" type="text/css">
i put this line of code in between the <head> and </head> tags, yet there was no change in my page, it still looks bland...
anyone know what I can do to fix this problem, or atlest get my style sheet to link with my page?
Your href attribute is followed by : Change this to = like rel and type. Also, throw http:// in front of the www
See if this helps any.
Edit: Also, if the file exists on the same server as the HTML file, then you should use relative paths. For instance, if you had a folder named "css" (yoursite.com/css) and you have your HTML files in the web root folder (yoursite.com/), then you would link the file like this:
<link rel=stylesheet href="css/style.css" type="text/css">
Link Tag
CSS Tutorials
See if this helps any.
Edit: Also, if the file exists on the same server as the HTML file, then you should use relative paths. For instance, if you had a folder named "css" (yoursite.com/css) and you have your HTML files in the web root folder (yoursite.com/), then you would link the file like this:
<link rel=stylesheet href="css/style.css" type="text/css">
Link Tag
CSS Tutorials
MatthaChew
Thanks so much for the reply. It works now when I try to use the link to my style sheet.
Thanks so much for the reply. It works now when I try to use the link to my style sheet.
href:"www.mywebsite.com/directory/subdirectory/textfile.css"
should be
href="http://www.mywebsite.com/directory/subdirectory/textfile.css"
to work correctly.
should be
href="http://www.mywebsite.com/directory/subdirectory/textfile.css"
to work correctly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement