Linking my site to the CSS file |
![]() ![]() |
Linking my site to the CSS file |
Jun 20 2008, 03:18 AM
Post
#1
|
|
|
Member ![]() ![]() Posts: 15 From: United Kingdom OS: windows Vista |
I just have a quick question. after building my website on my computer i could easily link my external CSS file to my site by specifying it's location in the head tags. I have now uploaded my website to a host site and I can't seem to link my CSS file to my pages anymore and my pages display without CSS! I have changed the location in the header tags to what I believe to be correct but its still not working. On the host site My index page is located in httpdocs/index.html My CSS file is located in httpdocs/css/default.css My head tags read the following: <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Signify Promotions</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="httpdocs/css/default.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 { font-size: xx-large; font-weight: bold; } .style3 { font-size: 34px } .style5 { font-size: large } .style6 {color: #AD32FF} .style8 {font-size: 9px} --> </style> Is the problem simply specifying the location to my CSS file in the head tags? Any feedback would very much appreciated. Thanks Taz |
|
|
Jun 20 2008, 03:59 AM
Post
#2
|
|
|
Spyware Veteran Posts: 20,730 From: Netherlands OS: XP Pro & Vista Ultimate |
<link href="httpdocs/css/default.css" rel="stylesheet" type="text/css" />
That looks wrong. If the situation is as you described, this should work. CODE <link href="css/default.css" rel="stylesheet" type="text/css" /> |
|
|
Jun 20 2008, 04:14 AM
Post
#3
|
|
|
Member ![]() ![]() Posts: 15 From: United Kingdom OS: windows Vista |
Yess! that has fixed it! Thank you very much Metallica I knew it was something fairly simple!
Thanks Taz |
|
|
Jun 20 2008, 04:27 AM
Post
#4
|
|
|
Spyware Veteran Posts: 20,730 From: Netherlands OS: XP Pro & Vista Ultimate |
Glad I was able to help.
You may assume I learned that one from experience. Uploading the files and thereby messing up the releative paths. Been there, done that. |
|
|
Jun 20 2008, 04:37 AM
Post
#5
|
|
|
Member ![]() ![]() Posts: 15 From: United Kingdom OS: windows Vista |
Hi Thanks again.
Is it normal for your CSS to veiw properly on your computer but when uploaded to the host some of the styles don't display such as in my case all that the CSS has done is the layout, it has disregarded the colours for some reason! is this common? Cheers |
|
|
Jun 20 2008, 04:47 AM
Post
#6
|
|
|
Spyware Veteran Posts: 20,730 From: Netherlands OS: XP Pro & Vista Ultimate |
Can you give us a link to your site?
And tell us what's wrong? There shouldn't be any big differences. At worst some browser specific things, but nothing basic like colors. |
|
|
Jun 20 2008, 05:25 AM
Post
#7
|
|
|
Member ![]() ![]() Posts: 15 From: United Kingdom OS: windows Vista |
|
|
|
Jun 20 2008, 06:04 AM
Post
#8
|
|
|
Spyware Veteran Posts: 20,730 From: Netherlands OS: XP Pro & Vista Ultimate |
I see. It looks like these lines in your css don't work properly:
CODE background: #FFFFFF url(images/img01.gif) repeat-x; Although the syntax is valid, can you try replacing them like this: CODE background-color: #fff; background: url("../images/img01.gif"); background-repeat: repeat-x; Try it with that one. If that works you can do the others as well.
Reason for edit: info from Major Payne
|
|
|
Jun 20 2008, 07:00 AM
Post
#10
|
|
|
Member ![]() ![]() Posts: 15 From: United Kingdom OS: windows Vista |
Hey Metallica Wow that fixed it again! thanks once again! Why didn't it work before? before it was on one line, now its on 3 lines! what's difference? why should it make a difference?
Hi Major Payne. Thanks for your observation, i will also fix these. Thanks guys Taz |
|
|
Jun 20 2008, 07:04 AM
Post
#11
|
|
|
Spyware Veteran Posts: 20,730 From: Netherlands OS: XP Pro & Vista Ultimate |
You're welcome.
The difference is the relative paths again. Major Payne spotted that. background: url("../images/img01.gif"); ../ goes up one level you have to do that, because /images is not a subfolder of /css but they are in the same directory. |
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies / Views | Topic Information | |||||
|---|---|---|---|---|---|---|---|
![]() |
15 / 708 | 24th June 2005 - 10:02 AM Josiah started - last by Josiah |
|||||
![]() |
0 / 120 | 17th July 2007 - 09:54 AM wayne christian started - last by wayne christian |
|||||
![]() |
2 / 1,333 | 27th February 2008 - 11:31 PM HalfJax started - last by Metallica |
|||||
![]() |
0 / 47 | 16th November 2008 - 12:59 PM fyre.fairy started - last by fyre.fairy |
|||||
|
Time is now: 3rd December 2008 - 12:19 AM |
| Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. |