473,763 Members | 5,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

External CSS and HTML 2.0


I have been running tests on various doctypes and
found something interesting.

I set up a test page using this doctype...

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN">

....and put this in the head:

<link rel="stylesheet " type="text/css" href="http://www.example.com/test.css">

The page failed the W3C validator. Changing the above to...

<link rel="stylesheet " href="http://www.example.com/test.css">

....allowed the page to validate.

I already tell the browser what type of document test.css
is in my .htaccess file:

AddType 'text/css; charset=US-ASCII' .css
AddCharset US-ASCII .css
AddLanguage en-US .css

I repeated the test with HTML 4.01 strict and XHTML 1.1
pages (making the other changes needed) and it still validated.

Other than the usual Internet Explorer choking on XHTML 1.1
served as application/xhtml+xml, the HTML 2.0, HTML 4.01 strict
and the XHTML 1.1 test pages are all following the directives
in the CSS file just fine. The only quirk I found was that the
W3C CSS Validator couldn't find the CSS from the HTML/XHTML
file (but it validated when I pointed it at the CSS file).

Is there any good reason why that type="text/css" is found
in every example of using an extenal CSS that I can find?


-
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Jul 25 '08 #1
35 2370
Guy Macon wrote:
I have been running tests on various doctypes and
found something interesting.

I set up a test page using this doctype...

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN">

...and put this in the head:

<link rel="stylesheet " type="text/css" href="http://www.example.com/test.css">

The page failed the W3C validator.
Because HTML 2.0 didn't support the type attribute. No problem there, right?

Changing the above to...

<link rel="stylesheet " href="http://www.example.com/test.css">

...allowed the page to validate.
Sure.
>
I already tell the browser what type of document test.css
is in my .htaccess file:

AddType 'text/css; charset=US-ASCII' .css
AddCharset US-ASCII .css
AddLanguage en-US .css
Fascinating, perhaps, but wholly unrelated to HTML validity.
>
I repeated the test with HTML 4.01 strict and XHTML 1.1
pages (making the other changes needed) and it still validated.
The type="text/css" is required for embedded style information as per
http://www.w3.org/TR/html401/present....html#h-14.2.3. For external
style sheets, the requirement is not so clear, but perhaps you will be
satisfied with the text (second bulleted item) at
http://www.w3.org/TR/html401/present...fying-external ,
in case you haven't read it already?

"This allows the user agent to avoid downloading a style sheet for an
unsupported style sheet language."

I have no idea what other languages a stzle sheet might be in. Klingon?
[...]
Is there any good reason why that type="text/css" is found
in every example of using an extenal CSS that I can find?
>
-
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>

You know, this really annoys me every time I see you do it.
--
John
Trying to be a nice guy, if I may use that expression.
Jul 25 '08 #2
In article <48**********@n ews.bluewin.ch> ,
John Hosking <Jo**@DELETE.Ho sking.name.INVA LIDwrote:
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>
Guy Macon <http://www.GuyMacon.co m/Guy Macon <http://www.GuyMacon.co m/>

You know, this really annoys me every time I see you do it.
Me too but in addition, put it down to bias, I would be as annoyed if he
didn't.

--
dorayme
Jul 25 '08 #3

John Hosking wrote:
>
Guy Macon <http://www.GuyMacon.co m/wrote:
>I already tell the browser what type of document test.css
is in my .htaccess file:

AddType 'text/css; charset=US-ASCII' .css
AddCharset US-ASCII .css
AddLanguage en-US .css

Fascinating, perhaps, but wholly unrelated to HTML validity.

I believe that it is related to HTML validity. From:
http://www.w3.org/TR/html401/present....html#h-14.2.1

|
|Authors must specify the style sheet language of style
|information associated with an HTML document.
|
|...
|
|The default style sheet language may also be set with HTTP
|headers. The above META declaration is equivalent to the
|HTTP header:
|
|Content-Style-Type: text/css
|

....which is, of course what putting

AddType 'text/css; .css

in the .htaccess file does on Apache servers.

My take on this (and, it seems, the take of the authors of the
DTD that the w3C HTML Validator uses for HTML 4.01 Strict) is
that the requirement is to specify that the style sheet is
text/css before the browser downloads it. This can be (and
usually is) done with [ type="text/css" ] in the link in the
HTML docoment that calls the external style sheet, but it looks
tp me that specifing that the style sheet is text/css by serving
the stylesheet with a [ Content-Style-Type: text/css ] HTTP
header is also valid.

--

Microsoft Windows has detected an outdated internal organ.

The Microsoft Transplant Wizard is preparing your body
for the installation of a new kidney. Please wait...

Do you wish to make a backup copy of your existing kidney? [Y/N]

Installing kidney...10...2 0...30...40...5 0...60...70...

"ERROR 31337: Insufficient space
in abdominal cavity. Delete liver
to create additional organ space?"

[OK]
Jul 25 '08 #4
On 25 Jul, 07:06, Guy Macon <http://www.GuyMacon.co m/wrote:
John Hosking wrote:
Fascinating, perhaps, but wholly unrelated to HTML validity.

I believe that it is related to HTML validity. From:http://www.w3.org/TR/html401/present....html#h-14.2.1
Why does a W3C rec for HTML _4.01_ influence what's valid in HTML
_2.0_ ?
Jul 25 '08 #5
On Jul 24, 11:06*pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
You know, this really annoys me every time I see you do it.
Me too but in addition, put it down to bias, I would be as annoyed if he
didn't.

Man I guess my new thing is not going to please you either... But
mine is more an experiment.
--
Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
Travis Newbury <http://travisnewbury.b logspot.com/Flash Crap
Jul 25 '08 #6
Scripsit Guy Macon:
--
(This .sig is best displayed with a non-proportional
monotype font such as Courier with word wrap disabled)
You were already warned about irritating sigs, and you are just making
them worse. This seems to be consistent with the lack of relevant
content and the presence of chaotic structure in your messages proper.

Thank you for making it clear that your future postings should be
ignored. Please keep using the same forged From field until you have a
clue. Thank you in advance.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jul 25 '08 #7
Guy Macon wrote:
John Hosking wrote:
>Guy Macon wrote:
>>I already tell the browser what type of document test.css
is in my .htaccess file:

AddType 'text/css; charset=US-ASCII' .css
AddCharset US-ASCII .css
AddLanguage en-US .css
Fascinating, perhaps, but wholly unrelated to HTML validity.


I believe that it is related to HTML validity. From:
http://www.w3.org/TR/html401/present....html#h-14.2.1

|
|Authors must specify the style sheet language of style
|information associated with an HTML document.
|
|...
|
|The default style sheet language may also be set with HTTP
|headers. The above META declaration is equivalent to the
|HTTP header:
|
|Content-Style-Type: text/css
|
Okay, I see your point. I was trying to say that the HTML itself is
unaware what might be in the .htaccess file and doesn't know or care
even what headers are sent. The HMTL parser has to know the encoding of
the HTML document, but won't otherwise care about headers or Apache
configurations. The CSS file has to be locatable and readable when it
comes time to *render*, but the HTML and its parsing are separate.

But I see that the W3C doc you point to has a bit of a leak in it.
Ostensibly describing what's in an HTML document and what it means, it
starts pointing outside the document at HTTP headers (and their
lieutenants, the META declarations).

So whatever the limitations of the validator[1], if you've declared a
default style sheet language[2] via any legal method, you're in good shape.

[1] Did you say you got valid results for HTML 4.01 strict served
without the [ type="text/css" ] in the link and without the [ AddType
'text/css; .css ] in the .htaccess file? That is, without *any*
declaration of the type?

[2] 'Ts hardly a language, is it?
>
...
--
Thanks for fixing your delimiter. I had to do some work to quote your
sig. :-)
>
Microsoft Windows has detected an outdated internal organ.

The Microsoft Transplant Wizard is preparing your body
for the installation of a new kidney. Please wait...

Do you wish to make a backup copy of your existing kidney? [Y/N]

Installing kidney...10...2 0...30...40...5 0...60...70...

"ERROR 31337: Insufficient space
in abdominal cavity. Delete liver
to create additional organ space?"

[OK]
Longer, but funnier. From my experience, I'd expect that when one clicks
"OK", another dialog comes up that says

Deleting liver can cause problems and lead to system instability.
Are you sure you want to delete liver, or do you want to abort the
deletion (recommended)?

[Yes] [No] [Cancel]

--
John
My funny .sig is in the shop for maintenance.
Jul 25 '08 #8

"Jukka K. Korpela" <jk******@cs.tu t.fiwrote:
>You were already warned about irritating sigs, and you are just making
them worse. This seems to be consistent with the lack of relevant
content and the presence of chaotic structure in your messages proper.

Thank you for making it clear that your future postings should be
ignored. Please keep using the same forged From field until you have a
clue. Thank you in advance.
That time of month, is it?

Here's a dime, Jukka; go buy yourself a *real* newsreader. One that can be
configured to not display sigs that are proberly delimited with the pattern
"-- " on a line by itself.
>X-Newsreader: Microsoft Outlook Express
What an idiot you are. Using the worst possible news reader and then flaming
others because it cannot trim sigs. Moron.

Jul 25 '08 #9
Travis Newbury wrote:
>>Guy Macon <http://www.GuyMacon.co m/wrote:
>--
(This .sig is best displayed with a non-proportional
monotype font such as Courier with word wrap disabled)

# # # ####### ####### ####### ## # # # # # # # # ##### # # # # # # ##### ##### ##### # # ##### ##### # # #
# # # # # # # ## # # # # # # # # # # # # # # ## ## # # # # # # ## # # # # # ## ## #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# ####### # # ####### # # # # # # # # # # # # ### # # # # # # ####### # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # ## # # ## ## ## ## ## ## ## # # # # # # # # # # # # # # ## ## # # # # # # #
# # # # # # ## # # # # # # # # ## ##### ##### # # # # # ##### ##### # # ## ##### ##### # # #

Well that looks like hell...

He forgot the "Best viewed on a 24 inch monitor with your newsreader
maximized" disclaimer.
Jul 25 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1508
by: Chuck Mendell | last post by:
I am having problem with external javascripts. My OS is XP Pro. I am told to create an external javascript using a .js extension. (I did that) The external .js is very simple, containing: function a_message() { alert('I came from an external script! Ha, Ha, Ha!!!!'); } I am told to create an HTML page that accesses the .js script. (I did that).
5
37828
by: kinne | last post by:
Is it possible to pass a parameter to an external ".js" file? Kinne
1
2268
by: mb | last post by:
Hi, I picked up this JavaScript code (quiz code) at: http://javascript.internet.com/miscellaneous/multiple-choice-quiz.html and modified it (and may have deleted some line I shouldn't have) so that it looks like this on my web site: http://www.goalseek.net/Scripts/qa_XL_History.htm
4
3175
by: dennise9 | last post by:
My exeternal JS works fine when the call is placed in the page head or body. But if I call the same javascript from a (clicked) text link on the page, the script throws a JS error when it executes. Help! I can't figure this out. The external JS file is "members.js". Here's the code:
0
1237
by: dmcomer | last post by:
In the context of parsing and preserving HTML tags in an XSL stylesheet, I understand the difference between <xsl:value-of select="body"/> and <xsl:copy-of select="body> However, I am trying to, with a twist on the above, pass the copy-of string to an external XSLT function. That is, in .NET 2.0, I am attempting something like the following (not that .NET applies to the XSL below, but just so you know the environment context):
0
2025
by: =?Utf-8?B?c25naWxi?= | last post by:
I am having 3 issues with the WebBrowser control which may all be related. The HTML for the page is the standard Weather Magnet from weather.com. The actual HTML is at the bottom of this page. Issue 1: I am opening a page in the control in the development environment and the document comes up correctly. But, when I click a link in the resulting document, an external IE instance comes up with the requested page. I have see reference to...
5
3696
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually for repeated html im using the external js, i mean the TOP, BOTTOM they are repeated in every page, so i include them as functions in the external js and call them. Why it doesn't work?
3
1854
by: RICHARD BROMBERG | last post by:
I have a simple program to test using an external .js file. This external file contains some functions that I need to call from several html programs. The program as written below works fine. 1. <html> 2. <head> 3. <meta http-equiv="Content-Language" content="en-us"> 4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5. <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> 6. ...
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.