Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > XHMTL and CSS Problem

Reply
Thread Tools

XHMTL and CSS Problem

 
 
Matthias Braun
Guest
Posts: n/a
 
      02-01-2010
Yes, you are right. Posting it on a public server shows no problem. On
my host, only FF shows a problem, but not IE. So it seems to be an
Apache problem, not a HTML problem.

Now I will go through my Apache config to find the problem. Or who knows
more?

Matthias

C A Upsdell wrote:
> On 2010-01-31 12:18, Matthias Braun wrote:
>> Help!
>>
>> I am writing a XHTML webpage. The W3 validator says that everything is
>> OK, but the CSS file is ignored.
>>
>> <!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>
>> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
>> <meta http-equiv="Content-Language" content="en-us" />
>> <title>Portal login</title>
>> <link href="http://localhost/neu/portal.css" rel="stylesheet"
>> type="text/css" />
>> </head>
>> (...)
>>
>> If I am removing the first two lines describing the DOCTYPE, everything
>> works fine, but the W3 validator gives a warning. Who could help?

>
> Someone else had a similar problem a while back, and it turned out that
> the server was not providing the correct MIME type for the CSS file:
> some browsers, like FF, will ignore the CSS file if the MIME type is
> wrong and a Strict DOCTYPE is used.
>

 
Reply With Quote
 
 
 
 
richard
Guest
Posts: n/a
 
      02-01-2010
On Sun, 31 Jan 2010 15:05:40 -0500, Jonathan N. Little wrote:

> Matthias Braun wrote:
>> Help!
>>
>> I am writing a XHTML webpage. The W3 validator says that everything is
>> OK, but the CSS file is ignored.
>>
>> <!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>
>> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
>> <meta http-equiv="Content-Language" content="en-us" />
>> <title>Portal login</title>
>> <link href="http://localhost/neu/portal.css" rel="stylesheet"

>
> Because the resource is *not* publicly accessible. "localhost" is not a
> public domain.


localhost may have been edited so as not to give a valid working link by
design. as he did say everything validated and worked fine from the server.
 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      02-01-2010
On 31 Jan, 17:18, Matthias Braun <(E-Mail Removed)> wrote:
> Help!
>
> I am writing a XHTML webpage. The W3 validator says that everything is
> OK, but the CSS file is ignored.
>
> <!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>
> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
> <meta http-equiv="Content-Language" content="en-us" />
> * * <title>Portal login</title>
> * * <link href="http://localhost/neu/portal.css" rel="stylesheet"
> type="text/css" />
> </head>
> (...)


This looks more like a HTTP problem than a HTML problem, i.e. your CSS
content isn't being delivered.

I suggest installing Firefox with the Live HTTP Headers extension.
Clear your cache, then attempt to load the page. The HTTP Response
headers should show HTTP 200 success codes for both the HTML & CSS
documents (also any images etc.) Also check the MIME types for these
documents.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-01-2010
Matthias Braun wrote:
> Yes, you are right. Posting it on a public server shows no problem. On
> my host, only FF shows a problem, but not IE. So it seems to be an

[please stop top-posting]

> Apache problem, not a HTML problem.
>
> Now I will go through my Apache config to find the problem. Or who knows
> more?
>


Long ago some servers where configured with .css link to
"application/x-pointplus" which was troublesome, but that was quite a
while ago, Apache 1.x. In your httpd.conf|apache2.conf or a sub-config
(my Ubuntu servers have an included mime.conf all depends on distro)
there is the the directive

TypesConfig /etc/mime.types

to your servers default mime definitions. Now the default should be
text/css for css. Of course for servers that you do not have direct
control one could always add

AddType text/css .css

in an .htaccess file.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Matthias Braun
Guest
Posts: n/a
 
      02-01-2010
Great, now it works!

I have had in the .htaccess the following lines (don't ask me why):

<FilesMatch "\.(css|style)$">
SetHandler application/x-httpd-php
</FilesMatch>

I removed the lines and - voila - problem has gone!

Thanks,

Matthias

Jonathan N. Little wrote:
> Matthias Braun wrote:
>> Yes, you are right. Posting it on a public server shows no problem. On
>> my host, only FF shows a problem, but not IE. So it seems to be an

> [please stop top-posting]
>
>> Apache problem, not a HTML problem.
>>
>> Now I will go through my Apache config to find the problem. Or who knows
>> more?
>>

>
> Long ago some servers where configured with .css link to
> "application/x-pointplus" which was troublesome, but that was quite a
> while ago, Apache 1.x. In your httpd.conf|apache2.conf or a sub-config
> (my Ubuntu servers have an included mime.conf all depends on distro)
> there is the the directive
>
> TypesConfig /etc/mime.types
>
> to your servers default mime definitions. Now the default should be
> text/css for css. Of course for servers that you do not have direct
> control one could always add
>
> AddType text/css .css
>
> in an .htaccess file.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tunneling own XML content in XHMTL etc. Florian Weimer XML 6 02-05-2011 09:52 PM
RenderBeginTag() output not XHMTL compliant MatsL@newsgroups.nospam ASP .Net 3 10-09-2006 04:51 AM
Whining and bitching about MSIE 6 CSS bugs and CSS support =?ISO-8859-1?Q?G=E9rard_Talbot?= HTML 0 07-09-2005 06:48 AM
Question about using <br /> with 'strict' xhmtl BT HTML 4 02-14-2005 05:37 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments