/    Sign up×
Community /Pin to ProfileBookmark

Linking to css problem

Hi, I am linking my css to an .html page, but it seems like when I use my full website URL, the css appears differently than when I just start the link from the CSS folder.

ex: <link href=”http://www.netzeye.com/CSS/css.css” rel=”stylesheet” type=”text/css” />

as opposed to <link href=”CSS/css.css” rel=”stylesheet” type=”text/css” />

here is the page : [url]http://www.netzeye.com/index22.html[/url] & [url]http://www.netzeye.com/index222.html[/url] .

Why is it doing this?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 21.2008 — Different css documents: css.css and style.css
Copy linkTweet thisAlerts:
@IL14N4Jun 21.2008 — The first is an [B]absolute link /or path[/B], meaning this is the address to link

to this page from any site, or type in the address in you're web browser

and it'll take you exactly where this site is located on the web.

The second is a [B]relative link/ or path[/B], when you preview a html file within

you're local machine you're machine uses relative naming to refer to files.



[FONT=Courier New] CSS/css.css[/FONT]

This the relative link, this means the CSS folder is in the same

directory level as the html file and within this file is the css.css style sheet.

So, the style sheet is 1 directory down:

css.css


Both the html and style sheet on the same directory level :

[FONT=Courier New] css.css [/FONT]


Say instead of having the style sheet on at the same directory level the

stylesheet was up one directory how would it read when linking the style

sheet to the html file: [B].. [/B][I](mean up 1 directory)[/I]

[FONT=Courier New] ../CSS/css.css

Hopefully you have a basic understanding now.

[/FONT]
×

Success!

Help @Wasiu0607 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...