Connecting Tech Pros Worldwide Forums | Help | Site Map

link css declarations?

Dave Mausner
Guest
 
Posts: n/a
#1: Jul 20 '05
the html 4.01 standard says i can use:
<link type="text/css" href=file-name>
to include a style section. questions:

1. does the external style sheet have to contain <html> ... </html>?
2. does it have to contain <style> ... </style>?
3. is <link> recognized within html page <style>?
4. is the <link href> a relative url, i.e., just a file name, or must it be
fully qualified?

finally could you post a working tag example that includes an external style
sheet in your html? thanks.
--
dave mausner v.708-848-2775 c.312-wake-my-i



Johannes Koch
Guest
 
Posts: n/a
#2: Jul 20 '05

re: link css declarations?


Dave Mausner wrote:[color=blue]
> the html 4.01 standard says i can use:
> <link type="text/css" href=file-name>[/color]

No, it doesn't. href must be an URI.
[color=blue]
> to include a style section.[/color]

to include external style sheets.
[color=blue]
> questions:
>
> 1. does the external style sheet have to contain <html> ... </html>?[/color]

No, that's not CSS.
[color=blue]
> 2. does it have to contain <style> ... </style>?[/color]

No, that's not CSS.
[color=blue]
> 3. is <link> recognized within html page <style>?[/color]

What does the HTML 4.01 spec say?
[color=blue]
> 4. is the <link href> a relative url, i.e., just a file name, or must it be
> fully qualified?[/color]

It must be an URI.
[color=blue]
> finally could you post a working tag example that includes an external style
> sheet in your html? thanks.[/color]

foo.html:
<html>
<head>
<title>foo</title>
<link rel="stylesheet" type="text/css" href="foo.css">
</head>
<body>
<h1>foo</h1>
</body>
</html>

fo.css:
h1 {
color: #f00;
background-color: #fff;
}
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Stan Brown
Guest
 
Posts: n/a
#3: Jul 20 '05

re: link css declarations?


In article <CdYdb.22970$ev2.4400087@newssrv26.news.prodigy.co m> in
comp.infosystems.www.authoring.stylesheets, Dave Mausner
<net.ameritech@dmausner> wrote:[color=blue]
>the html 4.01 standard says i can use:
><link type="text/css" href=file-name>[/color]

Not quite. It's href="URL" not href=file-name. The style sheet can
be anywhere.
[color=blue]
>to include a style section. questions:
>
>1. does the external style sheet have to contain <html> ... </html>?[/color]

On the contrary, it must not.
[color=blue]
>2. does it have to contain <style> ... </style>?[/color]

On the contrary, it must not.
[color=blue]
>3. is <link> recognized within html page <style>?[/color]

No.
[color=blue]
>4. is the <link href> a relative url, i.e., just a file name, or must it be
>fully qualified?[/color]

It is a URL, which could be relative or absolute. You seem to think
that "relative URL" = "file name", and that is not true at all.
"../../abc/def/xyz.css" is a relative URL.
[color=blue]
>finally could you post a working tag example that includes an external style
>sheet in your html? thanks.[/color]

I can do better: I can show you the document you will wish you had
read before posting your questions:

http://www.htmlhelp.com/reference/css/style-html.html


--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
e n | c k m a
Guest
 
Posts: n/a
#4: Jul 20 '05

re: link css declarations?


> fo.css:[color=blue]
> h1 {
> color: #f00;
> background-color: #fff;
> }[/color]

ouch... that's not gonna work :)

change "fo.css" to "foo.css" hehe ;)


Johannes Koch
Guest
 
Posts: n/a
#5: Jul 20 '05

re: link css declarations?


e n | c k m a wrote:[color=blue][color=green]
>>fo.css:
>>h1 {
>> color: #f00;
>> background-color: #fff;
>>}[/color]
>
>
> ouch... that's not gonna work :)
>
> change "fo.css" to "foo.css" hehe ;)[/color]

Ooops, yes.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Dave Mausner
Guest
 
Posts: n/a
#6: Jul 20 '05

re: link css declarations?


"Stan Brown" <the_stan_brown@fastmail.fm> wrote in message
news:MPG.19e2bfa7964ecfb898b490@news.odyssey.net.. .[color=blue]
>
> I can do better: I can show you the document you will wish you had
> read before posting your questions:
>
> http://www.htmlhelp.com/reference/css/style-html.html
>[/color]

you are right, stan, i wish i had seen that one. it answers all my
questions. thanks.
--
dave mausner v.708-848-2775 c.312-wake-my-i


Closed Thread