I've done some CGI scripts, written in C++, about 10 years ago, but
haven't done any web related projects since. I want to get familiar
with web applications again.
To that end, I've loaded Apache on a PC running OpenSolaris so I
have a captive web host.
On my account I have the "Main" web page at
~/www/site.learn_html_htmldog/htdocs/index.html
This HTML file has a list with links to HTML files arranged in sub-
directories of htdocs.
I'm working through HTMLDog's tutorial, just starting the beginning
CSS at:
http://htmldog.com/guides/cssbeginner/applyingcss/
Files for this example are located at:
~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
applying_css
The first example is of an internal CSS, and works fine.
The next example is a separate CSS file, which looks like this:
----
p {
color: red;
}
a {
color: blue;
}
----
Should CSS files have a prologue? This example doesn't.
So I follow the text and create a file by this name and save it as
"web.css" in the applying_css directory, along with:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>My first web page</title>
<link rel="stylesheet" type="text/css" href="web.css" />
</head>
<body>
<h4>This uses an external stylesheet to set paragraphs and
anchors.</h4>
<p>This is a paragraph</p>
<a href="link_file.html">Link</a>
</body>
</html>
When I select this HTML, the CSS seems to be ignored, the paragraph
is displayed as black and the anchor is displayed as blue.
I've tried moving the CSS file to the htdocs directory, with no
effect.
What am I doing wrong?
Thanks
Larry
For this to work the web.css file would have to be in the root
directory, and it isn't. Given your situation you may be best off
specifying the full path in the LINK element.
Thanks C A:
I attempted to get this HTML through CSS and markup validation, and
after a little effort got this to pass both validations:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>My first web page</title>
<link rel="stylesheet" type="text/css" href="/web.css" />
<meta http-equiv="Content-Type" content="text/
html;charset=utf-8" />
</head>
<body>
<h4>This uses an external stylesheet to set paragraphs and
anchors.</h4>
<p>
This is a paragraph
<br />
<a href="link_file.html">Link</a>
</p>
</body>
</html>
As you suggested, I moved the CSS to my document root directory.
This makes a lot more sense than having it local, or linked, to each
directory that has HTML.
This XHTML passes both validations, but it still doesn't display
the paragraph or the link in the colors specified in the CSS.
Here again is the CSS. I have the anchor set to green, because its
different than the default to blue.
p {
color: red;
}
a {
color: green;
}
Here is my setup:
Server OS OpenSolaris 2009.06, kept as current as I can.
Apache version 2.2.13
Client OS Windows XP Pro
Firefox 3.5.5
I assume I'm making some dumb mistake, but I'm not seeing it.
I appreciate your assistance.
Thanks
Larry
Sigh. I gave you bad advice due to insomnia combined with profound fatigue.
Anyway, the href="web.css" will look for the CSS file in the *same*
directory as the HTML file.
As to why the text in your paragraph does not take on the colour you
want: best to put your stuff on the web, and give a URL, so that we can
see what you actually have rather than what you think you have.
Where exactly is your local file css?
You should have two lines before the </head>.
<style type="text/css">
p {}
a {}
</style>
</head>
> On Sat, 14 Nov 2009 23:35:55 -0800 (PST), Larry Lindstrom wrote:
>
>> <link rel="stylesheet" type="text/css" href="web.css" />
>
> You should have two lines before the </head>.
> <style type="text/css">
No, he shouldn't. He's trying to link to an external style sheet.
Did you even bother to read the post you replied to? If so, what part of
"external stylesheet" do you not understand? Have you ever thought of
actually *learning* HTML before you try to give advice about it?
sherm--
Thanks Again C A:
I have exposed port 80 through my firewall, that's how the
validation sites get to it.
But I'm reluctant to display my IP address, because I'm not
knowledgeable about security issues. Is there a site where I can put
these files?
Larry
Did you validate just the HTML, or the CSS as well?
> But I'm reluctant to display my IP address, because I'm not
> knowledgeable about security issues. Is there a site where I can put
> these files?
Years ago there were quite a few free hosting services, but I don't know
what is safe and available today. One problem with free hosting
services, though, is that they tend to add things to your web pages,
like ads, and the code they add can interfere with your own code.
One possibility is your ISP: some ISPs offer free web space to
subscribers, though this is less common than it used to be.
Perhaps someone else can make a suggestion as to a good free host.
<snip code>
1) Is your file "web.css" in your document root? Because that is what
you have specified.
2) Is it named "web.css" all lowercase, because it is case sensitive
(common Windows user error)
3) Is the document root of your in your apache config set to
~/www/site.learn_html_htmldog/htdocs/
or
~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
If it is the former then web.css should be in htdocs folder else it
should be in the css_beginner_tutorial folder.
Aside of reviewing your config files your can do some tests... If the
URL to your document is http://localhost/index.html then what happens
when you enter http://localhost/web.css in your browser? Do you get the
CSS file?
Confirm the link in your index.html file. Unfortunately Mozilla removed
Link Info from the Page Info window in Firefox 3.x. You can restore it
with this extension:
https://addons.mozilla.org/en-US/firefox/addon/6939
Then from your index.html view the "Tools > Page Info > Links" and
confirm what the stylesheet links resolved to...
Lastly, on a WAG, you don't have a permission problem with the web.css
file? It is readable for your apache|www-data user?
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
You go girl!
Thanks Again C A:
Both HTML and CSS passed. Both validators were passed the HTML's
address.
The instructions for the CSS validator state:
Enter the URI of a document (HTML with CSS or CSS only)
you would like validated
The HTML validation displays a pretty green:
This document was successfully checked as XHTML 1.0 Strict!
The CSS Valdation displays a pretty green:
Congratulations! No Error Found.
> > But I'm reluctant to display my IP address, because I'm not
> > knowledgeable about security issues. Â Is there a site where I can put
> > these files?
>
> Years ago there were quite a few free hosting services, but I don't know
> what is safe and available today. Â One problem with free hosting
> services, though, is that they tend to add things to your web pages,
> like ads, and the code they add can interfere with your own code.
>
> One possibility is your ISP: Â some ISPs offer free web space to
> subscribers, though this is less common than it used to be.
>
> Perhaps someone else can make a suggestion as to a good free host.
It's probably time to bite the bullet and get a site on a hosting
service.
It's Sunday here in the U.S. I'll look into it tomorrow.
Thanks
Larry
Another option would be to create a virtual machine, do your testing
within that machine, and delete it if it appears to be compromised.
Thanks Jonathan:
Yes. Moving it to /tmp, for a test, causes the CSS validation to
fail.
> 2) Is it named "web.css" all lowercase, because it is case sensitive
> (common Windows user error)
Yes, re-naming it "Web.css" causes the CSS validation to fail.
> 3) Is the document root of your in your apache config set to
>
> ~/www/site.learn_html_htmldog/htdocs/
> or
> ~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
"DocumentRoot /export/home/larryl/www/site.learn_html_htmldog/
htdocs"
That's the former, htdocs, directory.
> If it is the former then web.css should be in htdocs folder else it
> should be in the css_beginner_tutorial folder.
It is in htdocs.
> Aside of reviewing your config files your can do some tests... If the
> URL to your document ishttp://localhost/index.htmlthen what happens
> when you enter  http://localhost/web.cssin your browser? Do you get the
> CSS file?
This seems odd.
I've been using an XP machine to browse my Solaris host. Except
for this problem, that has been working.
But attempts to browse "httpd://localhost/" from Firefox running
on the Solaris PC fails with:
Failed to Connect
Firefox can't establish a connection to the server
localhost.
Substituting my IP address, returned from www.whatismyip.com, for
"localhost" results in a successful browse.
Back to your point. Browsing "httpd/<ip address>/web.css/" results
in:
Not Found
The requested URL /web.css/ was not found on this server.
Is there a protocol other than "http" I should be trying?
> Confirm the link in your index.html file. Unfortunately Mozilla removed
> Link Info from the Page Info window in Firefox 3.x. You can restore it
> with this extension:
>
> https://addons.mozilla.org/en-US/firefox/addon/6939
>
> Then from your index.html view the "Tools > Page Info > Links" and
> confirm what the stylesheet links resolved to...
>
> Lastly, on a WAG, you don't have a permission problem with the web.css
> file? It is readable for your apache|www-data user?
I'll try these if needed, but the CSS validation fails if I try to
move web.css or change the case of any character in it's name. Does
the fact that I get a nice green "Congratulations! No Error Found."
indicate that the CSS is present and readable?
The web.css is readable by group and others.
I saw that not all files in this site's directory structures are
owned by webgroup so I ran:
chgrp -R webgroup * and chaged everything except httpd.pid.
Still no luck.
I appreciate your efforts to assist me Jonathan.
Thanks
Larry
> Perhaps someone else can make a suggestion as to a good free host.
At http://www.000webhost.com/ you can get free hosting at $4.84 a month
cheaper than their cheapest paid hosting rate hosting.
They do tend to stick a little script link at the end of your html
source to count the traffic I suppose, (which I have never been able to
get turned off in spite of trying to follow a procedure to do this).
If you want to check your validation for any local HTML doc, you can
check via Web Developer tools, there is a menu to check local, it
uploads your local file to the validation service...
The paths you are using on your local Apache sound awfully complicated.
Why not forget about connecting things to paths with htmldog, it is just
an external web site, you can bookmark it. (It is not bad, but is
misleading in that it ought to be discouraging you from using XHTML for
the moment. But this is another issue.)
--
dorayme
CSS validation to fail? Not sure what you mean by that, do you mean not
found 404 error. If so, unless /tmp is alias or symbolically link within
your document root path of course it would not be found by the webserver!
>
>> 2) Is it named "web.css" all lowercase, because it is case sensitive
>> (common Windows user error)
>
> Yes, re-naming it "Web.css" causes the CSS validation to fail.
Again fail? Do you mean 'not found'?
>
>> 3) Is the document root of your in your apache config set to
>>
>> ~/www/site.learn_html_htmldog/htdocs/
>> or
>> ~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
>
> "DocumentRoot /export/home/larryl/www/site.learn_html_htmldog/
> htdocs"
Okay
>
> That's the former, htdocs, directory.
>
Which? 'htdocs' was the 'htdocs' or the 'site.learn_html_htmldog' was
the 'htdocs', or the 'www' was the 'htdocs'?
Also whatever you did to the filesystem it does match the DocumentRoot
directive in the httpd.conf? It this your default server or a vhost
site? Most times rather than change the default server's setting just
add a vhost for any development sites. Add plus is that you can have
*more than one*
NameVirtualHost *:80
<VirtualHost *:80>
ServerName learn_css.my.lan
DocumentRoot /var/www/vhosts/css
</VirtualHost>
<VirtualHost *:80>
ServerName test.my.lan
DocumentRoot /var/www/vhosts/test
</VirtualHost>
<VirtualHost *:80>
ServerName another_test.my.lan
DocumentRoot /somewhere/completely/different
</VirtualHost>
>> If it is the former then web.css should be in htdocs folder else it
>> should be in the css_beginner_tutorial folder.
>
> It is in htdocs.
Well if htdocs is your document root then the url '/web.css' should work.
>
>> Aside of reviewing your config files your can do some tests... If the
>> URL to your document ishttp://localhost/index.htmlthen what happens
>> when you enter http://localhost/web.cssin your browser? Do you get the
>> CSS file?
>
> This seems odd.
>
> I've been using an XP machine to browse my Solaris host. Except
> for this problem, that has been working.
>
> But attempts to browse "httpd://localhost/" from Firefox running
> on the Solaris PC fails with:
If you are not browsing from the machine that the webserver is running
then http://localhost should fail, 'localhost' means your machine. the
one your using aka 127.0.0.1 or loopback address.
>
> Failed to Connect
> Firefox can't establish a connection to the server
> localhost.
>
> Substituting my IP address, returned from www.whatismyip.com, for
> "localhost" results in a successful browse.
>
> Back to your point. Browsing "httpd/<ip address>/web.css/" results
^^ ^
1 3
No, http://<ip address>/web.css
[1] protocol is "http://"
[2] no trailing "/" else Apache will parse "web.css" as a directory
> in:
>
> Not Found
>
> The requested URL /web.css/ was not found on this server.
>
> Is there a protocol other than "http" I should be trying?
>
>> Confirm the link in your index.html file. Unfortunately Mozilla removed
>> Link Info from the Page Info window in Firefox 3.x. You can restore it
>> with this extension:
>>
>> https://addons.mozilla.org/en-US/firefox/addon/6939
>>
>> Then from your index.html view the "Tools> Page Info> Links" and
>> confirm what the stylesheet links resolved to...
>>
>> Lastly, on a WAG, you don't have a permission problem with the web.css
>> file? It is readable for your apache|www-data user?
>
> I'll try these if needed, but the CSS validation fails if I try to
> move web.css or change the case of any character in it's name. Does
> the fact that I get a nice green "Congratulations! No Error Found."
> indicate that the CSS is present and readable?
>
> The web.css is readable by group and others.
>
> I saw that not all files in this site's directory structures are
> owned by webgroup so I ran:
>
> chgrp -R webgroup * and chaged everything except httpd.pid.
> Still no luck.
>
Well I would look in the httpd.conf for the proper user. The default
install 2.x it has been
User www-data
Group www-data
In the past with 1.x
User apache
Group apache
Of course defaults don't matter it is what is in your httpd.conf that
counts.
> If you want to check your validation for any local HTML doc, you can
> check via Web Developer tools, there is a menu to check local, it
> uploads your local file to the validation service...
I should have mentioned Firefox (and related browsers where you can add
these tools). Yo can also, of course, check validation of local via
other means.
--
dorayme
I've heard of a boy named "Sue" but never a girl named "Sherm"...
--
Neredbojias
http://www.neredbojias.org/
http://www.neredbojias.net/
Thanks Again Jonathan:
You asked if web.css was in the document root directory, and if it
was named with the correct case of characters.
The point I was making is yes. If the CSS file had not been in the
document root, or if it had been spelled with characters whose case
differed from the name used in the HTML,
the validation would have failed.
> >> 2) Is it named "web.css" all lowercase, because it is case sensitive
> >> (common Windows user error)
>
> > Â Â Yes, re-naming it "Web.css" causes the CSS validation to fail.
>
> Again fail? Do you mean 'not found'?
>
>
>
> >> 3) Is the document root of your in your apache config set to
>
> >> ~/www/site.learn_html_htmldog/htdocs/
> >> or
> >> ~/www/site.learn_html_htmldog/htdocs/css_beginner_tutorial/
>
> > Â Â "DocumentRoot /export/home/larryl/www/site.learn_html_htmldog/
> > htdocs"
>
> Okay
>
>
>
> > Â Â That's the former, htdocs, directory.
>
> Which? 'htdocs' was the 'htdocs' or the 'site.learn_html_htmldog' was
> the 'htdocs', or the 'www' was the 'htdocs'?
~/www is a folder with several sites in it. The site I'm using for
HTMLDog's tutorials, the site I'm using for w3school's tutorials and
several sites out of the O'Reilly Apachie book.
> Also whatever you did to the filesystem it does match the DocumentRoot
> directive in the httpd.conf? It this your default server or a vhost
> site? Most times rather than change the default server's setting just
> add a vhost for any development sites. Add plus is that you can have
> *more than one*
I'm currently working on the HTMLDog tutorial, so Apache is
configured to use that site.
I haven't worked with virtual hosts. It might be appropriate, but
I'm interested in getting up to speed with HTML before I deal with
other issues.
> NameVirtualHost *:80
> <VirtualHost *:80>
> Â Â ServerName learn_css.my.lan
> Â Â DocumentRoot /var/www/vhosts/css
> </VirtualHost>
>
> <VirtualHost *:80>
> Â Â ServerName test.my.lan
> Â Â DocumentRoot /var/www/vhosts/test
> </VirtualHost>
>
> <VirtualHost *:80>
> Â Â ServerName another_test.my.lan
> Â Â DocumentRoot /somewhere/completely/different
> </VirtualHost>
>
> >> If it is the former then web.css should be in htdocs folder else it
> >> should be in the css_beginner_tutorial folder.
>
> > Â Â It is in htdocs.
>
> Well if htdocs is your document root then the url '/web.css' should work.
Yea, that's what I'm thinking. :)
> >> Aside of reviewing your config files your can do some tests... If the
> >> URL to your document ishttp://localhost/index.htmlthenwhat happens
> >> when you enter  http://localhost/web.cssinyour browser? Do you get the
> >> CSS file?
>
> > Â Â This seems odd.
>
> > Â Â I've been using an XP machine to browse my Solaris host. Â Except
> > for this problem, that has been working.
>
> > Â Â But attempts to browse "httpd://localhost/" Â from Firefox running
> > on the Solaris PC fails with:
>
> If you are not browsing from the machine that the webserver is running
> thenhttp://localhostshould fail, 'localhost' means your machine. the
> one your using aka 127.0.0.1 or loopback address.
>
>
>
> > Â Â Â Â Â Â Failed to Connect
> > Â Â Â Â Â Â Firefox can't establish a connection to the server
> > localhost.
>
> > Â Â Substituting my IP address, returned fromwww.whatismyip.com, for
> > "localhost" results in a successful browse.
>
> > Â Â Back to your point. Â Browsing "httpd/<ip address>/web.css/" results
>
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ^^ Â Â Â Â Â Â Â Â Â Â ^
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1 Â Â Â Â Â Â Â Â Â Â 3
>
> No, http://<ip address>/web.css
The "httpd" was a typo from copying the text.
Removing the trailing "/" resulted in web.css being displayed.
They look good to me.
My guess is that this is something simple that I'm overlooking
it.
I'm going to get a web host this week and I'll be able to show what
I'm doing there.
Jonathan, as stated before, I appreciate your assistance.
Thanks
Larry
<snip>
> ~/www is a folder with several sites in it. The site I'm using for
> HTMLDog's tutorials, the site I'm using for w3school's tutorials and
> several sites out of the O'Reilly Apachie book.
>
>> Also whatever you did to the filesystem it does match the DocumentRoot
>> directive in the httpd.conf? It this your default server or a vhost
>> site? Most times rather than change the default server's setting just
>> add a vhost for any development sites. Add plus is that you can have
>> *more than one*
>
> I'm currently working on the HTMLDog tutorial, so Apache is
> configured to use that site.
So are you editing your main server's document root for each "site" that
you work on? If so, not only is that cumbersome, but prone to error
(which might be your current problem). Also you can only run *one* site
at a time. Far better to leave the main server setting alone at the
default /var/www/html with just some "Yah it works!" page or better to
your Apache documentation. Then for your sites just add vhosts like below...
Easy to do see:
http://httpd.apache.org/docs/2.2/vhosts/
You probably want *name-based* virtual hosts as I have shown.
> I haven't worked with virtual hosts. It might be appropriate, but
> I'm interested in getting up to speed with HTML before I deal with
> other issues.
>
>> NameVirtualHost *:80
>> <VirtualHost *:80>
>> ServerName learn_css.my.lan
>> DocumentRoot /var/www/vhosts/css
>> </VirtualHost>
>>
>> <VirtualHost *:80>
>> ServerName test.my.lan
>> DocumentRoot /var/www/vhosts/test
>> </VirtualHost>
>>
>> <VirtualHost *:80>
>> ServerName another_test.my.lan
>> DocumentRoot /somewhere/completely/different
>> </VirtualHost>
>>
--
Thanks Again Jonathan:
You certainly are persistent, aren't you? :)
I didn't want to worry about Apache virtual hosts, but I know I'll
want to use them at some point.
The CSS isn't progressing that well, so why not now?
I've copied the conf and logs directories from www/
site.learn_html_htmldog to www, and modified httpd.conf to have two
virtual hosts, enough to start for now.
Modified the XP machine's hosts files and now I have virtual hosts
working.
On startup, Apache does post this complaint:
httpd: Could not reliably determine the server's fully
qualified domain name,
using ::1 for ServerName
But I can identify either virtual host to Firefox and the correct
site comes up.
I'm sure I'll want to tune up the virtual host configurations, but
I have basic functionality, thanks to you.
This doesn't get the CSS working, but it is an improvement to my
configuration.
Thanks
Larry
Using the ethnic "You go girl" in this situation is implying that I am
encouraging Shemp to continue on his rant against evil (in this case,
evil is in the shape of an external style sheet). The "girl"
reference, in this example, truly has no gender attached to it and can
easily be applied to Shemp.
Sorry if this caused any confusion.
> httpd: Could not reliably determine the server's fully
> qualified domain name,
> using ::1 for ServerName
Because ::1 is not really a valid name. Just use a FQDN that is not
valid for hte internet so that your private server does not conflict
with any possible one online. Using a TLD of 'lan' or 'private' works.
Works well for local development mirrors of *real* live websites
www.example.com => online on live server
www.example.lan => offline on local lan
>
> But I can identify either virtual host to Firefox and the correct
> site comes up.
>
> I'm sure I'll want to tune up the virtual host configurations, but
> I have basic functionality, thanks to you.
>
> This doesn't get the CSS working, but it is an improvement to my
> configuration.
Very strange. This should work even with local files and no webserver
/* start of file named sample.css */
.special { color: red; }
/* end of file named sample.css */
<!-- start of file named sample.html -->
<html>
<head>
<title>A test</title>
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<p>This text should be black but change to <span class="special">
red where I have applied the class 'special'</span>. Now back to
black.</p>
</body>
</html>
<!-- end of file named sample.html -->
If both files sample.css & sample.html this should always work. The only
possible error is mime type text/css is not defined for css files, but
this was long ago should be defined in your config by default.
I see. Actually, the phrase conjured in my mind a considerably
different scenario. Several women were in a queue for the loo. As
unbelievable as it sounds, they are not gibbering amongst themselves
but silently anticipating their moment of relief. Suddenly, the first
in line hears a pitiful moan, turns, and beholds the woman immediately
behind her. This second woman is pressing her crotch, her face is
contorted and her eyes are floating. Just then the bathroom door opens
and in an act of selfless heroinism, the first woman points to the
commode and says, "You go girl!"
Hell, I almost relieved myself after having that thought-image.
Thanks Again Jonathan:
Well, here's my dumb mistake.
It works fine until I put the prolog in! The following has all the
syntactic sugar to pass the HTML and CSS validations.
Try running this, smart guy. :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>A test of a linked file in another directory</title>
<link rel="stylesheet" type="text/css" href="/sample.css" />
</head>
<body>
<p>This text should be black but change to <span class="special">
red where I have applied the class 'special'</span>. Now back to
black.</p>
</body>
</html>
The HTML and CSS validation loves this HTML. But the CSS is
ignored.
I'd like to learn this web stuff with solid techniques, like
writing to the XHTML strict standard.
How do I do that?
I've had all kinds of "fun" with virtual hosting. Some of my sites
are available, others not so much. I'll play with that a bit and
probably post another response later tonight.
As usual, I appreciate your guidance.
Thanks
Larry
Thanks Again Jonathan:
Well, here's my dumb mistake.
It works fine until I put the prolog in! The following has all the
syntactic sugar to pass the HTML and CSS validations.
Try running this, smart guy. :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>A test of a linked file in another directory</title>
<link rel="stylesheet" type="text/css" href="/sample.css" />
</head>
<body>
<p>This text should be black but change to <span class="special">
red where I have applied the class 'special'</span>. Now back to
black.</p>
</body>
</html>
The HTML and CSS validation loves this HTML. But the CSS is
Not sure what you mean by the "prolog": if you mean the DOCTYPE, and
that it works unless you have the DOCTYPE, this strongly suggests a
standards violation exists.
> <html xmlns="http://www.w3.org/1999/xhtml">
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
> <title>A test of a linked file in another directory</title>
> <link rel="stylesheet" type="text/css" href="/sample.css" />
> </head>
> <body>
> <p>This text should be black but change to <span class="special">
> red where I have applied the class 'special'</span>. Now back to
> black.</p>
> </body>
> </html>
This XHTML appears to be clean, but I wonder what the CSS file looks
like. This is a case where a URL would be terrifically useful.
Thanks C A:
I'll get a host this week. I'm reluctant to publish my IP
address. I do have port 80 exposed and NAT enabled in my firewall for
the validation suites.
The CSS and HTML is copied from Jonathan Little's post.
The CSS is:
.special { color: red; }
The HTML that works is:
<html>
<head>
<title>A test</title>
<link rel="stylesheet" type="text/css" href="sample.css">
</head>
<body>
<p>This text should be black but change to <span class="special">
red where I have applied the class 'special'</span>. Now back to
black.</p>
</body>
</html>
I've added a "/" before "sample.css" in the link statement. That
change didn't cause a problem. The specified "special" text is red.
Adding:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
with no other changes resulted in the CSS being ignored. I added more
syntax to get the code through the HTML and CSS validation.
There might be a standards violation, but the validation suites
didn't find it.
I appreciate your effort.
Thanks
Larry
Thanks again Jonathan:
I found some permission issues in some of the files under "www".
Everything works now.
But I'm still getting this warning:
httpd: Could not reliably determine the server's fully
qualified domain name,
using ::1 for ServerName
Here is the httpd.conf:
User webuser
Group webgroup
listen 192.168.1.50:80
NameVirtualHost *:80
<VirtualHost *:80>
ServerName learn_htmldog
DocumentRoot /export/home/larryl/www/site.learn_html_htmldog/htdocs
</VirtualHost>
<VirtualHost *:80>
ServerName learn_w3school
DocumentRoot /export/home/larryl/www/site.learn_html_w3schools/
htdocs
</VirtualHost>
<VirtualHost *:80>
ServerName j_little
DocumentRoot /export/home/larryl/www/site.j_little/htdocs
</VirtualHost>
I've attempted to change the server names to look like
"www.j_little.lan".
I've attempted to change the VirtualHost tab to
<VirtualHost www.j_little.lan>
I've attempted several different things, some of which cause Apache
to fail to launch.
I don't understand your suggestion to resolve the problem Apache
complains about.
> > Â Â But I can identify either virtual host to Firefox and the correct
> > site comes up.
>
> > Â Â I'm sure I'll want to tune up the virtual host configurations, but
> > I have basic functionality, thanks to you.
>
> > Â Â This doesn't get the CSS working, but it is an improvement to my
> > configuration.
>
> Very strange. This should work even with local files and no webserver
This has been addressed in another post.
One question. You warned me to not use XHTML when learning HTML.
Referring to HTMLDog's tutorial: "is misleading in that it ought to
be discouraging you from using XHTML for the moment"
Is this a problem that you anticipated I'd run into? Why did you
admonish me to avoid XHTML?
Thanks again for your effort.
Larry
Using valid code is essential, but not everything. Valid code is simply
code which is syntactically correct, i.e. complies with the language
definition. But you can still have standards violations with valid code
if you count on behaviour which is incorrect: for example, if you assume
that the browser will use the IE box model as it is implemented in IE in
quirks mode.
The code you cite appears clean, but I am wondering whether there is
something else in the files which you are not telling us about, because
you think it is irrelevant.
Many designers strongly oppose the use of XHTML because IE does not
support it: IE treats XHTML as HTML.
I myself use XHTML exclusively, and have never had a problem, but this
is because I carefully follow the guidelines given in Appendix C of the
XHTML standards: this ensures compatibility with browsers which don't
explicitly support XHTML.
Newbies could run into unexpected problems with XHTML because they don't
yet know how to adhere to the guidelines. So using HTML initially is
probably safer.
Because "::1" is not valid for a server name, do you have that for the
server's hostname? In fact your vhosts server names are also invalid,
they cannot contain the "_" character.
<http://help.websiteos.com/support/valid_characters_and_length_for_a_domain_name.htm>
>
> Here is the httpd.conf:
>
> User webuser
> Group webgroup
> listen 192.168.1.50:80
> NameVirtualHost *:80
>
> <VirtualHost *:80>
> ServerName learn_htmldog
> DocumentRoot /export/home/larryl/www/site.learn_html_htmldog/htdocs
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName learn_w3school
> DocumentRoot /export/home/larryl/www/site.learn_html_w3schools/
> htdocs
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName j_little
> DocumentRoot /export/home/larryl/www/site.j_little/htdocs
> </VirtualHost>
That vhost *part* of the httpd.conf, it bettter not be the *whole*
httpd.conf, if so that could be your problem. There should be the base
server definition, the part outside of any <IfModule>, <VirtualHost>,
<Directory>, <Files>, or <Location> directive blocks usually at the
start of the httpd.conf
ServerName example.lan
>
> I've attempted to change the server names to look like
> "www.j_little.lan".
>
> I've attempted to change the VirtualHost tab to
>
> <VirtualHost www.j_little.lan>
>
> I've attempted several different things, some of which cause Apache
> to fail to launch.
>
> I don't understand your suggestion to resolve the problem Apache
> complains about.
As stated above "www.j_little.lan" is not valid, "www.jlittle.lan" or
"www.j.little.lan" or "jlittle.lan" are all fine
>
>>> But I can identify either virtual host to Firefox and the correct
>>> site comes up.
>>
>>> I'm sure I'll want to tune up the virtual host configurations, but
>>> I have basic functionality, thanks to you.
>>
>>> This doesn't get the CSS working, but it is an improvement to my
>>> configuration.
>>
>> Very strange. This should work even with local files and no webserver
>
> This has been addressed in another post.
>
> One question. You warned me to not use XHTML when learning HTML.
>
> Referring to HTMLDog's tutorial: "is misleading in that it ought to
> be discouraging you from using XHTML for the moment"
>
> Is this a problem that you anticipated I'd run into? Why did you
> admonish me to avoid XHTML?
>
It has bed explained ad nauseam in the NG, Google is your friend here. I
will list just one strong argument against using xhtml:
Whether you love IE or not, it still commands a large usership and NO
version, not even IE8, will handle xhtml properly served. Use any
version of IE and you will not be able to see this page:
http://www.littleworksstudio.com/temp/usenet/xhtml1.0
Thanks Again C A:
One thing I've noticed is that there is no reference to "css" in
the mime.types file.
I've posted the entire XHTML and CSS.
Is there a potential threat posed by my posting my IP address? I'm
guarded by a home type Linksys firewall/router. Behind that is are
three PCs, one dual booting XP Mediacenter and Opensolaris, another
booting Windows 2000, and the third dual booting Solaris and XP Pro.
Being protected by the Linksys, the Windows PCs are not running a
software firewall.
For all I know, my home IP address is already included in this
post's NNTP header.
Perhaps I can email my IP address to you.
Using that IP address, you can see the HTML source that works,
because it doesn't have the prologue and other syntax for validation,
and links to three almost identical HTML files. The first one works,
because it is exactly the HTML Jonathan posted. The second and third
fail, because they do have the validated syntax.
With Jonathan's assistance, I now have Apache setup to run virtual
hosts. It only takes a couple of minutes to create a new site.
I don't know what you have for computer resources, but have you
attempted to duplicate what I've done? I'd be curious if I'm the only
one experiencing this behavior.
I do appreciate your assistance.
Larry
>It has bed explained ad nauseam in the NG, Google is your friend here. I
>will list just one strong argument against using xhtml:
^^^^^^
You misspelled "specious".
>
>Whether you love IE or not, it still commands a large usership and NO
>version, not even IE8, will handle xhtml properly served.
Incorrect. IE will not handle XHTML _properly served as XML_.
> Use any
>version of IE and you will not be able to see this page:
>
>http://www.littleworksstudio.com/temp/usenet/xhtml1.0
>
Why do you think that the only way XHTML is "properly served" is as
application/xhtml+xml ?
That's the only way to properly serve it _as XML_.
But it may *also* be properly served _as HTML_: "XHTML 1.0 can be served as
HTML or XML. If you serve it as XML, use the MIME type application/xhtml+xml."
http://www.w3.org/International/articles/serving-xhtml/ in the Summary section
near the bottom of the page.
My email address, slightly disguised to prevent spammers from harvesting it:
cupsdellI...@IGNORETHISupsdell.com
> I don't know what you have for computer resources, but have you
> attempted to duplicate what I've done? I'd be curious if I'm the only
> one experiencing this behavior.
I don't have your HW/SW environment.
Long and tedious argument. What advantage will xhtml offer over html,
except added complications with IE?
Thanks again C A and Jonathan:
C A, I'll send you my IP address as soon as I'm finished with this
post.
With Jonathan's help, I do have virtual hosts working. With a
complaint from Apache.
But I don't want to worry about trying to add an IP based virtual
host to a list of named virtual hosts, so I'm reverting to the single
host httpd.conf file:
-----
User webuser
Group webgroup
ServerName my586
DocumentRoot /export/home/larryl/www/site.j_little/htdocs
listen 192.168.1.50:80
-----
As you can see, no issue with invalid characters in an IP address.
The site at the IP address I've sent you has Jonathan's original
HTML with four links added to the end.
The first link is jonathan's exact HTML, and that works.
The second is his HTML, but with an HTML 4.1 DOCTYPE.
The third is a version of his HTML with syntax added to pass the
HTML 4.1 and CSS validation with no errors or warnings.
The fourth link is a version of that compliant HTML, but with the
DOCTYPE removed.
I've found that the two versions of Jonathan's HTML that have no
DOCTYPE properly display their text, as specified by the CSS. The two
HTML files that have DOCTYPE don't properly display text, there is no
red portion.
I'm going to be away from my computer for most of the day, leaving
in about an hour.
Thanks
Larry
I used the Firefox Error Console. When I load the page with the full
DOCTYPE, where standards should be strictly applied, the Error Console
gives the message:
Error: The stylesheet http://71.59.134.28/sample.css was not loaded
because its MIME type, "text/plain", is not "text/css".
But if I load the page with the DOCTYPE missing, where quirks mode
should govern, the Error Console gives the messsage:
Warning: The stylesheet http://71.59.134.28/sample.css was loaded as CSS
even though its MIME type, "text/plain", is not "text/css".
So the problem is that the server is not providing the proper CSS mime
type, and evidently this results in the CSS file being ignored in strict
mode by browsers which apply the standards most strictly. To fix the
problem the server must be reconfigured, but unfortunately I don't know
how to tell you how to do this. Google will probably help here.
Thanks Again C A:
I'm out the door now. I'll take a look at this situation in about
6 hours.
Larry
That was my guess. I believe that the OP does not have a complete
"default" http.conf but is missing most of it's configuration
There should be LoadModule directives in the global part of the
httpd.conf The one missing I think is
LoadModule mime_module modules/mod_mime.so
That loads the standard mime types. You could just add
AddType test/css .css
as a hack in the httpd.conf or .htaccess file, but he should really just
add the standard modules in httpd.conf. May Ubuntu/Debian servers add
the modules by having a mods-enabled folder, but old RH and Mandrake
included them in the httpd.conf
A little OT here, the OP should get himself the O'Reilly "pony" boot,
but some typical modules to install are:
LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
LoadModule auth_basic_module /usr/lib/apache2/modules/mod_auth_basic.so
LoadModule authn_file_module /usr/lib/apache2/modules/mod_authn_file.so
LoadModule authz_default_module
/usr/lib/apache2/modules/mod_authz_default.so
LoadModule authz_groupfile_module
/usr/lib/apache2/modules/mod_authz_groupfile.so
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
LoadModule authz_user_module /usr/lib/apache2/modules/mod_authz_user.so
LoadModule autoindex_module /usr/lib/apache2/modules/mod_autoindex.so
LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so
LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
LoadModule env_module /usr/lib/apache2/modules/mod_env.so
LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so
LoadModule status_module /usr/lib/apache2/modules/mod_status.so
Ian quite effectively lays out the "complications" and pitfalls, (and
the numerous cries for help in the very NG novices get bit by xhtml)
http://hixie.ch/advocacy/xhtml
Also if you claim "no advantages" what is the point?
<obscure_cartoon_ref>
Said the Tallest, "Because it is aaaaaadvanced!"
</obscure_cartoon_ref>
Thanks Again C A and Jonathan:
I guess that means the W3C validation suites aren't sufficient to
ferret out this problem. Now I know where Firefox's error counsel is,
thanks.
I'm so confused right now I don't know what to do.
In August I downloaded Apache 2.2.13.
I built it from source using Sun's compiler:
$ ./configure --prefix=<Install directory name>
$ make
$ make install
This went without a hitch.
Something I do periodically, for instance today, as root, is run:
find / -depth -print > /opt/local/find_all.
This gives me a list of every file on my system.
I've searched find_all for a file called "mod_mime.so" and found
that no such file exists on my system.
I've searched for "mod_alias.so", "mod_auth_basic.so",
"mod_authn_file.so" and "mod_cgi.so".
Nothing.
A search of the Apache site for "mod_mime.so" turns up a section
titled "Apache Module mod_mime", but a search of that page for
"mod_mime.so" comes up empty.
The module identifier is "mime_module".
The source file is "mod_mime.c". Is there a C file by that name on
my system? Yes there is!
But has it been built? Is it in a library somewhere? I went to
the install directory's lib directory and ran "nm" against the
libraries there. I found nothing.
Where can I find this default httpd.conf file?
I have downloaded the sample files for O'Reilly's Apache book, ran
find and grep only to find the term "mime" is used by one httpd.conf
file. The httpd.conf file for the "site.simple" example. And that
reference is "TypesConfig conf/mime.types".
Speaking of the O'Reilly's Apache book, third edition, on page 40
they recommend against starting with a massive httpd.conf file and
modifying it to fit. They say "It is much better to start with a
completely minimal file and add to it what is absolutely necessary."
Which explains the current state of my httpd.conf files.
I don't know what to do now.
It's into the wee hours here on the US West coast, time for bed.
As I've said so many times in this thread. I appreciate the effort
you two have made to help me.
Thanks
Larry
> I'm so confused right now I don't know what to do.
>
> In August I downloaded Apache 2.2.13.
>
> I built it from source using Sun's compiler:
>
> $ ./configure --prefix=<Install directory name>
> $ make
> $ make install
>
> This went without a hitch.
I've always installed the package for my distro so it always
preconfigures with working base install.
>
> Something I do periodically, for instance today, as root, is run:
>
> find / -depth -print> /opt/local/find_all.
>
> This gives me a list of every file on my system.
>
> I've searched find_all for a file called "mod_mime.so" and found
> that no such file exists on my system.
>
> I've searched for "mod_alias.so", "mod_auth_basic.so",
> "mod_authn_file.so" and "mod_cgi.so".
>
The modules on my Ubuntu servers is /usr/lib/apache2/modules, for my
website which is Redhat they are /usr/lib/httpd/modules I have no idea
for Solaris but I would assume something similar. I have these modules
available by default:
libphp5.so
mod_actions.so
mod_alias.so
mod_asis.so
mod_auth_basic.so
mod_auth_digest.so
mod_authn_alias.so
mod_authn_anon.so
mod_authn_dbd.so
mod_authn_dbm.so
mod_authn_default.so
mod_authn_file.so
mod_authnz_ldap.so
mod_authz_dbm.so
mod_authz_default.so
mod_authz_groupfile.so
mod_authz_host.so
mod_authz_owner.so
mod_authz_user.so
mod_autoindex.so
mod_cache.so
mod_cern_meta.so
mod_cgid.so
mod_cgi.so
mod_charset_lite.so
mod_dav_fs.so
mod_dav_lock.so
mod_dav.so
mod_dbd.so
mod_deflate.so
mod_dir.so
mod_disk_cache.so
mod_dumpio.so
mod_env.so
mod_expires.so
mod_ext_filter.so
mod_file_cache.so
mod_filter.so
mod_headers.so
mod_ident.so
mod_imagemap.so
mod_include.so
mod_info.so
mod_ldap.so
mod_log_forensic.so
mod_mem_cache.so
mod_mime_magic.so
mod_mime.so
mod_negotiation.so
mod_proxy_ajp.so
mod_proxy_balancer.so
mod_proxy_connect.so
mod_proxy_ftp.so
mod_proxy_http.so
mod_proxy.so
mod_rewrite.so
mod_setenvif.so
mod_speling.so
mod_ssl.so
mod_status.so
mod_substitute.so
mod_suexec.so
mod_unique_id.so
mod_userdir.so
mod_usertrack.so
mod_version.so
mod_vhost_alias.so
>
> A search of the Apache site for "mod_mime.so" turns up a section
> titled "Apache Module mod_mime", but a search of that page for
> "mod_mime.so" comes up empty.
>
> The module identifier is "mime_module".
>
> The source file is "mod_mime.c". Is there a C file by that name on
> my system? Yes there is!
Those would be the recompiled versions. Maybe you did not include them
during your build.
>
> But has it been built? Is it in a library somewhere? I went to
> the install directory's lib directory and ran "nm" against the
> libraries there. I found nothing.
>
> Where can I find this default httpd.conf file?
>
Typically it is in:
/etc/apache2/
/etc/httpd
For Apache2 most times httpd.conf is an empty file for legacy and the
actual config is in apache2.conf. Debian breaks up the configuration
into modular configs which I have found very useful, Redhat still puts
everything in one httpd.conf. The source package has template that
should have created the config for your system. The template
httpd.conf.in is in the the tar.gz at httpd-2.2.13/docs/conf I noticed a
mime.types file there that does have text/css defined.
Maybe you should just install the binary package for Solaris
http://archive.apache.org/dist/httpd/binaries/solaris/
It should be already preconfigured with a working default server instead
of rolling your own from the start.
Also the NG more on topic might be alt.apache.configuration...
I was addressing specifically the claim that *you* made, not those made by
anyone else.
>
>http://hixie.ch/advocacy/xhtml
>
>Also if you claim "no advantages" what is the point?
I also didn't claim that it offered "no advantages". I made no claims one way
or the other about advantages or lack thereof -- I only pointed out that the
disadvantage *you* claimed exists in fact does not.
Thanks Again Jonathan:
I've posted to alt.apache.configuration.
Larry
Well you can "point out" all you want, you can even claim that pigs can
fly, but it doesn't make it true. There are plenty of articles and
evidence for while xhtml may have potential at the current state of the
internet and prevalence of of IE the benefits are not realized and
deployment can be problematic. I just referenced one article that listed
some of the problems.
> Doug Miller wrote:
> > I only pointed out that
> > the disadvantage *you* claimed exists in fact does not.
>
> Well you can "point out" all you want, you can even claim that pigs can
> fly, ...
I am taking bets on this not being the last pointing out. Our Doug is
very persistent and so you should get good odds betting against it.
Please send all monies to dorayme, c/o Sydney.
--
dorayme
I, too, think it's better to use html than xhtml, and here's one reason
for that.
A bit shy of a year ago I made 2 pages of medium complexity. They were
identical except for the necessary diffs to have one as xhtml and the
other not. Everything was up-to-snuff, valid and all that, and, of
course, the xhtml page was served as application xhtml+xml.
Testing in Firefix indicated that the xhtml page was being parsed by
the xhtml/xml parser, different from the regular html (or sgml) parser.
In any case, there were some standards-compliant problems in the xhtml
page not appearing in the html page and I guarantee they weren't caused
by any markup errors. I couldn't, naturally, try this in ie, and by
the time I thought of experimenting with Opera and Safari, I just
decided to stick with html, anyway.
If what I've read about html5 is true, the xhtml/html disparity will
become almost moot in the future as both will function under the same
"umbrella". -Just my 2 cents worth.
--
Neredbojias
http://www.neredbojias.org/
http://www.neredbojias.net/
Oh I am aware. Hard to counter the debate after "'cuz" assertion, my
comments where more to inform the OP.
>Well you can "point out" all you want, you can even claim that pigs can
>fly, but it doesn't make it true. There are plenty of articles and
>evidence for while xhtml may have potential at the current state of the
>internet and prevalence of of IE the benefits are not realized and
>deployment can be problematic. I just referenced one article that listed
>some of the problems.
>
You continue to miss the point -- which was that my comments were very
narrowly targeted to _one_specific_ erroneous claim which you made.
Apparently you prefer to drag in an entire netful of red herrings, in
preference to admitting that you were mistaken.
Some people are just that way. Too bad for you.
Enlighten me, and probably anyone else that bothers to continue with
this thread, what _one specific_ erroneous claim?
> Doug Miller wrote:
> > In article<he27aj$fvs$1...@news.eternal-september.org>, "Jonathan N.
> > Little"<lws...@gmail.com> wrote:
> >
> >> Well you can "point out" all you want, you can even claim that pigs can
> >> fly, but it doesn't make it true. ...
> >>
> > You continue to miss the point -- which was that my comments were very
> > narrowly targeted to _one_specific_ erroneous claim which you made.
> >
...
> Enlighten me, and probably anyone else that bothers to continue with
> this thread, what _one specific_ erroneous claim?
It goes back to your - imo, quite correct - "NO version, not even IE8,
will handle xhtml properly served". You are being baled up for not
acknowledging (and implying the opposite) that it is quite proper to
serve otherwise.
As I see it, Doug Miller may be missing that there is something *less
than quite proper* - even though it is a widespread practice - in
crippling the main intent of XHTML by serving it up as html and that
there is an argument that XHTML as served with a text/html MIME type is
in fact invalid html:
<http://webkit.org/blog/68/understanding-html-xml-and-xhtml/>
Given that there these issues, I want him to be more polite and fair to
you. It's not much to ask on such a hot Sydney avo.
--
dorayme
That is, indeed, exactly the erroneous claim to which I refer. If in your
opinion that claim is correct, then you also are at odds with the W3C, which
states explicitly -- as I cited in my post -- that XHTML may be properly
served as *either* HTML *or* XML. To claim that it can be properly served
*only* as XML is, quite simply, false.
>
>As I see it, Doug Miller may be missing that there is something *less
>than quite proper* - even though it is a widespread practice - in
>crippling the main intent of XHTML by serving it up as html and that
>there is an argument that XHTML as served with a text/html MIME type is
>in fact invalid html:
>
><http://webkit.org/blog/68/understanding-html-xml-and-xhtml/>
All arguments about which way is better or worse aside, the fact remains that
it is indeed "proper" to serve XHTML as HTML, and anyone who claims otherwise
is misinformed. If you disagree, take it up with the W3C, not with me: I
didn't set the standard. They did.
...
> All arguments about which way is better or worse aside, the fact remains that
> it is indeed "proper" to serve XHTML as HTML, and anyone who claims otherwise
> is misinformed. If you disagree, take it up with the W3C, not with me: I
> didn't set the standard. They did.
Ah but you are the one putting all the heavy weight on the word "proper"
which does not appear in the quote you originally offered:
"XHTML 1.0 can be served as HTML or XML. If you serve it as XML, use the
MIME type application/xhtml+xml."
You are deducing that it is a *proper* way to serve it. It is not a word
one would naturally choose when one is pointing out all the downsides
and the various dirty things that happen. It gives too false an
impression of menchy kosherness.
As for me being at odds with the W3C, I doubt I am getting *that* lucky
here, they were not to know what weight someone would put on the word
"proper".
A piece of bacon and a sausage were frying in a pan
when the sausage suddenly exclaimed
"Phew, it's hot in here!". The bacon then said:
"Wow! A sausage that talks!"
--
dorayme
> That is, indeed, exactly the erroneous claim to which I refer. If in your
> opinion that claim is correct, then you also are at odds with the W3C, which
> states explicitly -- as I cited in my post -- that XHTML may be properly
> served as *either* HTML *or* XML. To claim that it can be properly served
> *only* as XML is, quite simply, false.
That is where you are wrong. It depends on which version of xhtml, xhtml
1.0 per Appendix C set as html compatible yes, but not xhtml 1.1
http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/#summary
If you read what Doug Miller said earlier, you would have noticed that
he specifically said 1.0. Not 1.1.
> If you read what Doug Miller said earlier, you would have noticed that
> he specifically said 1.0. Not 1.1.
He may have but in my initial remarks that he criticized I did not
specify. But it utilize the features of xhtml that would offer and
advantage over html, it needs to be parsed as xml. MathML one example,
but...
Word games. It's very clear that according to the W3C, it's perfectly OK to
serve XHTML as HTML -- contrary to what Jonathon claimed.
And that's what I objected to.
> Word games.
That is pretty much what I am complaining you are doing. I have said
why.
> It's very clear that according to the W3C, it's perfectly OK to
> serve XHTML as HTML -- contrary to what Jonathon claimed.
It does not make it clear that it is *perfectly OK*. And no one is
saying it is *perfectly bad* to use xhtml and serve it some way.
--
dorayme
> spam...@milmac.com (Doug Miller) wrote:
>> Word games.
>
> That is pretty much what I am complaining you are doing. I have said
> why.
>
>> It's very clear that according to the W3C, it's perfectly OK to serve
>> XHTML as HTML -- contrary to what Jonathon claimed.
>
> It does not make it clear that it is *perfectly OK*. And no one is
> saying it is *perfectly bad* to use xhtml and serve it some way.
My recollection is that when Internet Explorer receives XHTML served as
text/html, the browser goes into Quirks Mode. Still true?
Let's see ...
http://www.w3.org/International/articles/serving-xhtml/ (2007-07-13)
Apparently, the Quirks Mode thing was fixed with IE7, so if you don't
care about visitors still using IE6 or less, go ahead and use
"text/html". And if you do use "application/xhtml+xml", all IE versions
will just offer to "download the file." Still true with IE8? I have no
IE (Windows) computers to test it anymore.
--
-bts
-Friends don't let friends drive Windows
Perhaps you need to read that quote from the W3C again.
> And no one is
>saying it is *perfectly bad* to use xhtml and serve it some way.
Perhaps you need to read Jonathon's post again.
Never true, exactly. There was a problem if the DOCTYPE was not on the
first line, and it might not be on the first line if the encoding was
neither UTF-8 nor UTF-16 and if the encoding could not be determined by
a higher level protocol, since in such cases an XML declaration was
necessary prior to the DOCTYPE to specify the encoding. But if the
DOCTYPE was on the first line, IE correctly set the mode appropriate to
the DOCTYPE.
> In article <doraymeRidThis-77F...@news.albasani.net>, dorayme
> <dorayme...@optusnet.com.au> wrote:
> >In article <he9j7e$252$1...@news.eternal-september.org>,
> > spam...@milmac.com (Doug Miller) wrote:
> >
> >> Word games.
> >
> >That is pretty much what I am complaining you are doing. I have said
> >why.
> >
> >> It's very clear that according to the W3C, it's perfectly OK to
> >> serve XHTML as HTML -- contrary to what Jonathon claimed.
> >
> >It does not make it clear that it is *perfectly OK*.
>
> Perhaps you need to read that quote from the W3C again.
>
This one: "XHTML 1.0 can be served as HTML or XML. If you serve it as
XML, use the MIME type application/xhtml+xml." ?
Note that this is a *summary remark* for what went before it.
I don't see any use of the word "proper" in this, nor do I see any heavy
leaning on some particular meaning of it. So it is a matter of your
deductions and interpretations. JL was interested in pointing out a few
things where it would have been inappropriate to use the word "proper"
when he thinks so poorly of the practice for good reasons.
> > And no one is
> >saying it is *perfectly bad* to use xhtml and serve it some way.
>
> Perhaps you need to read Jonathon's post again.
I have it framed. It is one of the most beautiful things on my wall now.
I see no implication in it that serving it as html is perfectly bad as
opposed to just bad or not very practical at the moment.
--
dorayme
Sure your *can* send any XHTML as text/html but unless you parse as xml
your lose the features of XHTML that were to make it "better" than HTML.
And as an added bonus it will typically throws IE in to quirks mode
usually blowing your layout![*] So putting the word games aside, if you
are not using the features of XHTML that require XML parsing there is no
advantage of using XHTML over HTML, and may be a disadvantage.
[*] Plenty of examples online of "experts" that bork their layouts using
XHTML throwing IE in to quirks mode. Then the "fix" it by tweaking their
stylesheets only to find it then borks their layout for "modern"
browsers, and then they "fix" everything with CSS hacks and conditional
comments...
But doesn't the XML declaration, e.g.,
<?xml version="1.0" encoding="UTF-8"?>
have to precede the DOCTYPE in order to be a valid XML document?
If you read the XHTML 1.0 spec, section 3.1.1, you will find that what I
said is correct. The XML declaration may be omitted if the encoding is
UTF-8 or UTF-16, or if the encoding can be specified by a higher level
protocol.
There is another, unrelated benefit from using XHTML. XHTML must be
well formed to be valid: HTML need not be. Unpleasant problems can
lurk when the code is not well formed.
> And as an added bonus it will typically throws IE in to quirks mode
"Typically"? Not true, as is discussed elsewhere in this thread: it
only threw *old* versions of IE into quirks mode, and only when it was
necessary to precede the DOCTYPE with an XML declaration. I use XHTML
for all but one of my sites, and none throws IE into quirks mode unless
it is IE 4 or 5, which *have* no standards mode. IE 4 is extinct; IE 5
is extinct except for a few sites which attract a disproportionate
number of IE 5 users.
<snort>
>I see no implication in it that serving it as html is perfectly bad as
>opposed to just bad or not very practical at the moment.
>
In that case, I think you need to read it yet *again*. It certainly did imply
that serving XHTML as HTML was improper -- and that's not correct.
You will succeed in the end. I will see what he says as incorrect by a
process called Lassitudo Ignoratum. There are some benefits to authors
using XHTML. But if you look at the present state of affairs, roundly at
everything relevant, I am saying it may be too heavy to insist too
loudly on the properness of the practice. I admire your tenacity though.
The heat in Sydney is sapping my will.
(btw, I like the business of XHTML (served as whatever) not supporting
deprecated things. See how I am trying to end on a nice note? Never mind
that I have an ulterior motive. Sharks have been seen and I am about to
go for a swim and I want to build up brownie points with any Higher
Powers that might exist).
--
dorayme
Ah that would be true IF it was parsed as XML, (you get that ugly yellow
error page in Firefox), but since you cannot with IE, IE just sees bad
HTML not well formed or otherwise.
>
>> And as an added bonus it will typically throws IE in to quirks mode
>
> "Typically"? Not true, as is discussed elsewhere in this thread: it only
> threw *old* versions of IE into quirks mode, and only when it was
> necessary to precede the DOCTYPE with an XML declaration. I use XHTML
> for all but one of my sites, and none throws IE into quirks mode unless
> it is IE 4 or 5, which *have* no standards mode. IE 4 is extinct; IE 5
> is extinct except for a few sites which attract a disproportionate
> number of IE 5 users.
Okay, but still as as text/html you cannot use the XML features so again
I say why bother? Just use HTML, make it valid and be done with it! When
either MS decides to have IE support XHTML, or it dwindles to
insignificance, there is not much benefit in using XHTML.
You say that IE just sees bad HTML: but it correctly processes what it
sees if Appendix C of the XHTML specification is observed, hence calling
the code "bad" is pointless and misleading.
>>> And as an added bonus it will typically throws IE in to quirks mode
>>
>> "Typically"? Not true, as is discussed elsewhere in this thread: it only
>> threw *old* versions of IE into quirks mode, and only when it was
>> necessary to precede the DOCTYPE with an XML declaration.
>
> Okay, but still as as text/html you cannot use the XML features so again
> I say why bother?
Because, as I pointed out earlier, use of XHTML guarantees that the
validated code will be well formed, and this eliminates certain classes
of coding errors and browser bugs, and this helps make it possible to
produce better pages in less time.
> You say that IE just sees bad HTML: but it correctly processes what it
> sees if Appendix C of the XHTML specification is observed, hence calling
> the code "bad" is pointless and misleading.
But if it is seeing it as HTML and there is an error it will not fail as
it would as XML, right?
>>
>> Okay, but still as as text/html you cannot use the XML features so
>> again I say why bother?
>
> Because, as I pointed out earlier, use of XHTML guarantees that the
> validated code will be well formed, and this eliminates certain classes
> of coding errors and browser bugs, and this helps make it possible to
> produce better pages in less time.
And this is somehow better than just validating your code?
> Because, as I pointed out earlier, use of XHTML guarantees that the
> validated code will be well formed, and this eliminates certain classes
> of coding errors and browser bugs, and this helps make it possible to
> produce better pages in less time.
This is not very convincing to those of us who simply out of habit,
mostly:
1. Validate HTML 4.01 Strict.
2. Avoid deprecated markup and use CSS with what is not deprecated.
3. Close our elements assisted ably by a quality text editor like BBEDit
(I have an older version already) that when I command control Y not only
validates but refuses to let me get away with not closing such as
paragraph elements.
As for browser bugs, I will be happy to be informed/reminded which ones
I am running a risk with after following the last three numbered points.
--
dorayme
???
>>> Okay, but still as as text/html you cannot use the XML features so
>>> again I say why bother?
>>
>> Because, as I pointed out earlier, use of XHTML guarantees that the
>> validated code will be well formed, and this eliminates certain classes
>> of coding errors and browser bugs, and this helps make it possible to
>> produce better pages in less time.
>
> And this is somehow better than just validating your code?
Yes
Sadly, my editor has no option to force the code to be well formed, the
lint program I have demands well formed code only for XHTML, and of
course validators demand well formed code only for XHTML.
> As for browser bugs, I will be happy to be informed/reminded which ones
> I am running a risk with after following the last three numbered points.
Your methodology achieves the same results as mine, so the risks are
comparable. But your methodology is not available to me.
When a UA is handling a document XML if it encounters an error, it is
not supports to "guess" error handling and display the document, but
rather fail with an error. The well-formed requirement of XML and XHTML.
But HTML which is SGML-based has a more flexible syntax. When it
encounters an error, contrary to XML with HTML UA's are encouraged to
"try" display document
<http://www.w3.org/TR/html4/appendix/notes.html#notes-invalid-docs>
So if an XHTML documents is not parsed as XML and instead handled as
HTML what happens with an invalid document?
To illustrate my point, as text/html:
<http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?text/html>
As application/xhtml+xml:
<http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?application/xhtml+xml>
As application/xml:
<http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?application/xml>
As test/xml:
<http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?text/xml>
So if you are not using XML features and just going to send well-formed
HTML anyway, then just use well formed HTML.
> To illustrate my point, as text/html:
>
> <http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?text/ht
> ml>
>
> As application/xhtml+xml:
> <http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?applica
> tion/xhtml+xml>
>
> As application/xml:
> <http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?applica
> tion/xml>
>
> As test/xml:
> <http://www.littleworksstudio.com/temp/usenet/xhtml1.0-invalid?text/xm
> l>
>
> So if you are not using XML features and just going to send
> well-formed HTML anyway, then just use well formed HTML.
Checkout this *HTML* page:
http://www.neredbojias.net/babesX.php
(-which I find particularly interesting in Safari.)
It's served as application/xhtml+xml to all but ie via server-side
script, and the w3c validator handles it fine. (Unerrored page without
the "X".)
--
Neredbojias
http://www.neredbojias.org/
http://www.neredbojias.net/