4 replies [Last post]
H.W.H.W.
H.W.H.W.'s picture
Offline
newbie
Last seen: 9 years 42 weeks ago
Timezone: GMT+8
Joined: 2010-11-26
Posts: 2
Points: 3

Hello, it's my 1st post here. I am making my first website and there is a little problem in linking the external style sheet.

Some basic info.:
1.) I'm using WAMP;
2.) XHTML 1.0 Strict
3.) Making a website called hwhw
4.) My website location : C:\wamp\www\hwhw\index.html
5.) My css location : C:\wamp\www\hwhw\code\master.css

I placed the following tag inside but it's not working:

After several tests, I delete the slash, then it becomes working as below:

I did some research I found most websites put a slash in the directory like my non-working example,
I wonder if I put the website online to the server, when every link is working fine or not.

Can anyone tell me is it really matter and if so, any suggestion please?

Thank you for your time! Tongue

Tags:
H.W.H.W.
H.W.H.W.'s picture
Offline
newbie
Last seen: 9 years 42 weeks ago
Timezone: GMT+8
Joined: 2010-11-26
Posts: 2
Points: 3

H.W.H.W. wrote: Hello, it's

H.W.H.W. wrote:

Hello, it's my 1st post here. I am making my first website and there is a little problem in linking the external style sheet.

Some basic info.:
1.) I'm using WAMP;
2.) XHTML 1.0 Strict
3.) Making a website called hwhw
4.) My website location : C:\wamp\www\hwhw\index.html
5.) My css location : C:\wamp\www\hwhw\code\master.css

I placed the following tag inside but it's not working:

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

After several tests, I delete the slash, then it becomes working as below:

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

I did some research I found most websites put a slash in the directory like my non-working example,
I wonder if I put the website online to the server, will every link is working fine or not.

Can anyone tell me is it really matter and if so, any suggestion please?

Thank you for your time! Tongue

Edited: Forgot the code tag, thanks for watching!

djsounds02
djsounds02's picture
Offline
Enthusiast
Burnley, UK
Last seen: 8 years 47 weeks ago
Burnley, UK
Joined: 2010-06-17
Posts: 110
Points: 134

http://www.coffeecup.com/help

http://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/ check this out the difference between the / being there and not is it decides whether it needs to navigate to find the file Read the article it should make you fully aware of paths.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Moving thread to 'Off Topic'

Moving thread to 'Off Topic' not a CSS issue!

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 49 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

You need to describe your

You need to describe your directory structure too.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference