Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to get to the root?

Reply
Thread Tools

How to get to the root?

 
 
SamuŽl van Laere
Guest
Posts: n/a
 
      10-12-2004
Hi friendly people (yeah even you Brucie beast),

I've just got a stupid question and it probally got an easy answer
i'm sure I once knew how to do it, but I forgot, so here goes:

root/style.css
root/mydirectory/page1.html

How can I include the style.css file into page1.html without using a
absolute url?

I'll try to remember it this time.

With regards,
SamuŽl van Laere
the Netherlands




 
Reply With Quote
 
 
 
 
Neal
Guest
Posts: n/a
 
      10-12-2004
On Tue, 12 Oct 2004 02:35:25 GMT, SamuŽl van Laere <(E-Mail Removed)>
wrote:

> Hi friendly people (yeah even you Brucie beast),
>
> I've just got a stupid question and it probally got an easy answer
> i'm sure I once knew how to do it, but I forgot, so here goes:
>
> root/style.css
> root/mydirectory/page1.html
>
> How can I include the style.css file into page1.html without using a
> absolute url?
>
> I'll try to remember it this time.


To refer to the root, start with / then indicate the path.

In your case, you could use /style.css (static) or ../style.css (relative).
 
Reply With Quote
 
 
 
 
Sam Hughes
Guest
Posts: n/a
 
      10-12-2004
"SamuŽl van Laere" <(E-Mail Removed)> wrote in news:NpHad.6874$G33.5351
@amsnews02.chello.com:

> Hi friendly people (yeah even you Brucie beast),
>
> I've just got a stupid question and it probally got an easy answer
> i'm sure I once knew how to do it, but I forgot, so here goes:
>
> root/style.css
> root/mydirectory/page1.html
>
> How can I include the style.css file into page1.html without using a
> absolute url?
>
> I'll try to remember it this time.


.../style.css

 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-12-2004
In alt.html SamuŽl van Laere said:

> Hi friendly people (yeah even you Brucie beast),


i really am a nice guy, people just use a nasty font in their
newsreaders that makes me sound evil. try a nice VladimirScrD and you'll
be pleasantly surprised.


--


v o i c e s
 
Reply With Quote
 
nice.guy.nige
Guest
Posts: n/a
 
      10-12-2004
While the city slept, brucie (****@usenetshit.info) feverishly typed...

> In alt.html SamuŽl van Laere said:
>
>> Hi friendly people (yeah even you Brucie beast),

>
> i really am a nice guy [...]


That's me, isn't it??

At least he got your name right! (apart from the surname, of course...)

Cheers,
Nige

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. http://www.velocityreviews.com/forums/(E-Mail Removed), take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!


 
Reply With Quote
 
marcus@myrealbox.com
Guest
Posts: n/a
 
      10-13-2004

On Tue, 12 Oct 2004 02:35:25 GMT, "SamuŽl van Laere" <(E-Mail Removed)> wrote:

>How can I include the style.css file into page1.html without using a
>absolute url?


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



 
Reply With Quote
 
Karl Core
Guest
Posts: n/a
 
      10-13-2004

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> On Tue, 12 Oct 2004 02:35:25 GMT, "SamuŽl van Laere" <(E-Mail Removed)>
> wrote:
>
>>How can I include the style.css file into page1.html without using a
>>absolute url?

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


Um, no. Try again.

-Karl


 
Reply With Quote
 
Neal
Guest
Posts: n/a
 
      10-13-2004
On Wed, 13 Oct 2004 11:08:04 -0400, Karl Core <(E-Mail Removed)>
wrote:

>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> On Tue, 12 Oct 2004 02:35:25 GMT, "SamuŽl van Laere" <(E-Mail Removed)>
>> wrote:
>>
>>> How can I include the style.css file into page1.html without using a
>>> absolute url?

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

>
> Um, no.


What's wrong with the above? I don't see it. Please point it out, and tell
me what would be correct.

It exactly parallels the line

<LINK rel="stylesheet" href="bach.css" type="text/css">

found at http://www.w3.org/TR/CSS21/intro.html . Except the ../ is used to
point the browser up a directory relative to the current one, which is
what OP wanted.
 
Reply With Quote
 
Karl Core
Guest
Posts: n/a
 
      10-13-2004

"Neal" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Wed, 13 Oct 2004 11:08:04 -0400, Karl Core <(E-Mail Removed)>
> wrote:
>
>>
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>
>>> On Tue, 12 Oct 2004 02:35:25 GMT, "SamuŽl van Laere" <(E-Mail Removed)>
>>> wrote:
>>>
>>>> How can I include the style.css file into page1.html without using a
>>>> absolute url?
>>>
>>> <link rel="stylesheet" href="../style.css" type="text/css">

>>
>> Um, no.

>
> What's wrong with the above? I don't see it. Please point it out, and tell
> me what would be correct.
>
> It exactly parallels the line
>
> <LINK rel="stylesheet" href="bach.css" type="text/css">
>
> found at http://www.w3.org/TR/CSS21/intro.html . Except the ../ is used to
> point the browser up a directory relative to the current one, which is
> what OP wanted.


That does not necessarily lead to root. If the page in question is three
directories deep and the style sheet is in the doc root, then it doesn't go
deep enough.
The answer would be <link rel="stylesheet" href="/style.css"
type="text/css">


-Karl


 
Reply With Quote
 
Neal
Guest
Posts: n/a
 
      10-13-2004
Karl Core wrote:
> "Neal" wrote
>> Karl Core wrote:
>>> <(E-Mail Removed)> wrote
>>>> <link rel="stylesheet" href="../style.css" type="text/css">
>>> Um, no.

>> What's wrong with the above?

> That does not necessarily lead to root. If the page in question is three
> directories deep and the style sheet is in the doc root, then it doesn't
> go deep enough.


Yes, I agree. But the poster gave an example of the directory structure
where the page was in the very next level (snipped in Marcus' reply).

root/style.css
root/mydirectory/page1.html

For the OP's situation, it should work fine. Though it is also true that
if the page were moved to a different directory level, unless the css file
was moved similarly the relationship would break.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
-Re: Re: Serious cache problem - Page_Load get never get called !!! Ryan Park ASP .Net 0 01-04-2005 06:09 PM
Serious cache problem - Page_Load get never get called !!! Ryan Park ASP .Net 2 01-03-2005 05:52 PM
Re: use anonymous but get get an authentication box Curt_C [MVP] ASP .Net 2 09-21-2004 06:39 PM
use anonymous but get get an authentication box =?Utf-8?B?U2hhcmlm?= ASP .Net 0 09-21-2004 01:01 PM



Advertisments