Newbie's CSS not having an effect.

J

Jonathan N. Little

Larry said:
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.
 
N

Neredbojias

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.

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

Larry Lindstrom

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 serverwww.example.lan=> offline on local lan






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.

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
 
L

Larry Lindstrom

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 serverwww.example.lan=> offline on local lan






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.

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
 
L

Larry Lindstrom

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 serverwww.example.lan=> offline on local lan






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.

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
 
C

C A Upsdell

Larry said:
It works fine until I put the prolog in! The following has all the
syntactic sugar to pass the HTML and CSS validations.

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

Larry Lindstrom

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.




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
 
L

Larry Lindstrom

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 serverwww.example.lan=> offline on local lan

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

C A Upsdell

Larry said:
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.

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

C A Upsdell

Larry said:
One question. You warned me to not use XHTML when learning HTML.

Is this a problem that you anticipated I'd run into? Why did you
admonish me to avoid XHTML?

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

Jonathan N. Little

Larry said:
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

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.

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
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
 
L

Larry Lindstrom

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.


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
 
D

Doug Miller

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

C A Upsdell

Larry said:
Perhaps I can email my IP address to you.

My email address, slightly disguised to prevent spammers from harvesting it:

(e-mail address removed)
> 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.
 
J

Jonathan N. Little

Doug said:
^^^^^^

You misspelled "specious".

Long and tedious argument. What advantage will xhtml offer over html,
except added complications with IE?
 
L

Larry Lindstrom

My email address, slightly disguised to prevent spammers from harvesting it:

(e-mail address removed)

  >    I don't know what you have for computer resources, but have you


I don't have your HW/SW environment.


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
 
C

C A Upsdell

It appears to be a server configuration problem.

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

Larry Lindstrom

It appears to be a server configuration problem.

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 stylesheethttp://71.59.134.28/sample.csswas 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 stylesheethttp://71.59.134.28/sample.csswas 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
 
J

Jonathan N. Little

C said:
It appears to be a server configuration problem.

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


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
 
D

Doug Miller

^^^^^^

You misspelled "specious".

Long and tedious argument. What advantage will xhtml offer over html,
except added complications with IE?
[/QUOTE]
I didn't claim that it offered any advantages. I merely pointed out that your
claim of the supposed "complications" doesn't hold any water.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top