By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,165 Members | 1,916 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,165 IT Pros & Developers. It's quick & easy.

link css declarations?

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dave Mausner wrote:
the html 4.01 standard says i can use:
<link type="text/css" href=file-name>
No, it doesn't. href must be an URI.
to include a style section.
to include external style sheets.
questions:

1. does the external style sheet have to contain <html> ... </html>?
No, that's not CSS.
2. does it have to contain <style> ... </style>?
No, that's not CSS.
3. is <link> recognized within html page <style>?
What does the HTML 4.01 spec say?
4. is the <link href> a relative url, i.e., just a file name, or must it be
fully qualified?
It must be an URI.
finally could you post a working tag example that includes an external style
sheet in your html? thanks.


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.)

Jul 20 '05 #2

P: n/a
In article <Cd*********************@newssrv26.news.prodigy.co m> in
comp.infosystems.www.authoring.stylesheets, Dave Mausner
<net.ameritech@dmausner> wrote:
the html 4.01 standard says i can use:
<link type="text/css" href=file-name>
Not quite. It's href="URL" not href=file-name. The style sheet can
be anywhere.
to include a style section. questions:

1. does the external style sheet have to contain <html> ... </html>?
On the contrary, it must not.
2. does it have to contain <style> ... </style>?
On the contrary, it must not.
3. is <link> recognized within html page <style>?
No.
4. is the <link href> a relative url, i.e., just a file name, or must it be
fully qualified?
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.
finally could you post a working tag example that includes an external style
sheet in your html? thanks.


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/
Jul 20 '05 #3

P: n/a
> fo.css:
h1 {
color: #f00;
background-color: #fff;
}


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

change "fo.css" to "foo.css" hehe ;)
Jul 20 '05 #4

P: n/a
e n | c k m a wrote:
fo.css:
h1 {
color: #f00;
background-color: #fff;
}

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

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


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

Jul 20 '05 #5

P: n/a
"Stan Brown" <th************@fastmail.fm> wrote in message
news:MP************************@news.odyssey.net.. .

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


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
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.