Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Linking my site to the CSS file


  • Please log in to reply

#1
inferlogic

inferlogic

    Member

  • Member
  • PipPip
  • 41 posts
Hi guys.
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
  • 0

Advertisements


#2
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
<link href="httpdocs/css/default.css" rel="stylesheet" type="text/css" />

That looks wrong. If the situation is as you described, this should work.
<link href="css/default.css" rel="stylesheet" type="text/css" />

  • 0

#3
inferlogic

inferlogic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 41 posts
Yess! that has fixed it! Thank you very much Metallica I knew it was something fairly simple!

Thanks
Taz
  • 0

#4
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
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. :)
  • 0

#5
inferlogic

inferlogic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 41 posts
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
  • 0

#6
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
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.
  • 0

#7
inferlogic

inferlogic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 41 posts
my website is www.signifypromotions.co.uk

I have attached a sample of what the website is supposed to look like
it just seems to be missing the colouring? odd

Thanks

Attached Thumbnails

  • web_sample2.jpg

Edited by inferlogic, 20 June 2008 - 05:32 AM.

  • 0

#8
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
I see. It looks like these lines in your css don't work properly:
background: #FFFFFF url(images/img01.gif) repeat-x;
Although the syntax is valid, can you try replacing them like this:
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.
  • 0

#9
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Bad path:

<img src="file:///C|/Users/tariq/Documents/signify promotions/Website/smooth/images/ad_120x600.jpg" alt="" width="120" height="600" />

Empty <li></li> pair.

20 minor HTML errors.


Broken images:

http://www.signifypromotions.co.uk/

1. http://www.signifypr...mages/img01.gif
2. http://www.signifypr...mages/img04.gif
3. http://www.signifypr...mages/img02.gif
4. http://www.signifypr...mages/img02.gif
5. http://www.signifypr...mages/img02.gif
6. http://www.signifypr...mages/img02.gif
7. http://www.signifypr...mages/img02.jpg
8. http://www.signifypr...mages/img04.gif
9. http://www.signifypr...mages/img06.gif
10. http://www.signifypr...mages/img07.gif
11. http://www.signifypr...mages/img08.gif
12. http://www.signifypr...mages/img07.gif
13. http://www.signifypr...mages/img08.gif
14. http://www.signifypr...mages/img04.gif
15. http://www.signifypr...mages/img06.gif
16. http://www.signifypr...mages/img04.gif
17. http://www.signifypr...mages/img06.gif
18. file:///C|/Users/tariq/Documents/signify%20promotions/Website/smooth/images/ad_120x600.jpg

Ron
  • 0

#10
inferlogic

inferlogic

    Member

  • Topic Starter
  • Member
  • PipPip
  • 41 posts
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
  • 0

#11
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
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.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP