/    Sign up×
Community /Pin to ProfileBookmark

if i have a .html file in a sub sub folder and using the <link> tag, i would like to reference to a css file which is in the root folder, is ../../file.css the only way to reference it, or is there any other command which can take you directly to the root folder instead of ../../ ?

Thank you

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@ToonMarinerJan 14.2007 — in html if you start any href with / that means site root.

so if you css is in ROOT/global/style/screen.css

then using

<link rel="stylesheet" type="text/css" href="/global/style/screen.css" media="screen" />

on ANY page in your site will grab the correct file.
Copy linkTweet thisAlerts:
@CassiusauthorJan 14.2007 — thx for your reply. So if the things is the other way round, that is the css file is in the root folder and the html file is in sub folders would /main.css will do rather than ../../main.css?
×

Success!

Help @Cassius 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 4.25,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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