XHMTL and CSS Problem

Discussion in 'HTML' started by Matthias Braun, Jan 31, 2010.

  1. 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?

    Thanks,

    Matthias
     
    Matthias Braun, Jan 31, 2010
    #1
    1. Advertising

  2. Matthias Braun wrote:

    > I am writing a XHTML webpage.


    Why?

    > The W3 validator says that everything is
    > OK, but the CSS file is ignored.
    >
    > <link href="http://localhost/neu/portal.css" rel="stylesheet"
    > type="text/css" />


    Is this on your home server, or your public web host?

    > If I am removing the first two lines describing the DOCTYPE,
    > everything works fine, but the W3 validator gives a warning. Who
    > could help?


    What happens if you use the highly-recommended HTML 4.01 Strict ?

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

    ...removing those extra slashes, of course: />

    http://tekrider.net/html/doctype.php

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
     
    Beauregard T. Shagnasty, Jan 31, 2010
    #2
    1. Advertising

  3. Matthias Braun

    Doug Miller Guest

    In article <4b65bb55$0$7624$-online.net>, 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?
    >

    Have you validated your stylesheet too?

    http://jigsaw.w3.org/css-validator/
     
    Doug Miller, Jan 31, 2010
    #3
  4. Beauregard T. Shagnasty wrote:

    > Matthias Braun wrote:
    >
    >> I am writing a XHTML webpage.

    >
    > Why?


    I guess the common reason is that HTML 4.01 lacks some tools to shoot on
    one's foot that XHTML kindly offers.

    >> If I am removing the first two lines describing the DOCTYPE,
    >> everything works fine, but the W3 validator gives a warning. Who
    >> could help?

    >
    > What happens if you use the highly-recommended HTML 4.01 Strict ?


    Probably nothing particular in this case.

    It sounds like the OP is using poorly written CSS, which is ignored by
    standards-conforming browsers as required by CSS specifications but
    "honored" in Quirks Mode, see
    http://www.cs.tut.fi/~jkorpela/quirks-mode.html

    The odds are that starting from scratch, after reading a decent tutorial in
    web authoring, is _much_ easier than trying to fix the broken code.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jan 31, 2010
    #4
  5. Doug Miller wrote:
    > In article <4b65bb55$0$7624$-online.net>, 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?
    >>

    > Have you validated your stylesheet too?

    Yes, I checked with the CSS validator
    http://jigsaw.w3.org/css-validator/#validate_by_upload with_options
    no problems reported.
    >
    > http://jigsaw.w3.org/css-validator/
     
    Matthias Braun, Jan 31, 2010
    #5
  6. Beauregard T. Shagnasty wrote:
    > Matthias Braun wrote:
    >
    >> I am writing a XHTML webpage.

    >
    > Why?
    >
    >> The W3 validator says that everything is
    >> OK, but the CSS file is ignored.
    >>
    >> <link href="http://localhost/neu/portal.css" rel="stylesheet"
    >> type="text/css" />

    >
    > Is this on your home server, or your public web host?

    I am using XAMPP on my home server.
    >
    >> If I am removing the first two lines describing the DOCTYPE,
    >> everything works fine, but the W3 validator gives a warning. Who
    >> could help?

    >
    > What happens if you use the highly-recommended HTML 4.01 Strict ?
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    > "http://www.w3.org/TR/html4/strict.dtd">
    >
    > ..removing those extra slashes, of course: />
    >
    > http://tekrider.net/html/doctype.php
    >

    This does not work, because the W3 validator
    http://validator.w3.org/check reports that this is not a XHTML document.
    Strange!

    Matthias
     
    Matthias Braun, Jan 31, 2010
    #6
  7. Matthias Braun wrote:

    >> Is this on your home server, or your public web host?

    > I am using XAMPP on my home server.


    Please read between the lines.

    Upload your document on a public server and post the URL, if you want others
    to help you.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jan 31, 2010
    #7
  8. Matthias Braun wrote:

    > Beauregard T. Shagnasty wrote:
    >> Matthias Braun wrote:
    >>> I am writing a XHTML webpage.

    >>
    >> What happens if you use the highly-recommended HTML 4.01 Strict ?
    >>
    >> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    >> "http://www.w3.org/TR/html4/strict.dtd">
    >>
    >> ..removing those extra slashes, of course: />
    >>
    >> http://tekrider.net/html/doctype.php
    >>

    > This does not work, because the W3 validator
    > http://validator.w3.org/check reports that this is not a XHTML document.
    > Strange!


    "What" does not work? What is not an XHTML document? My page? Which
    one?

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
     
    Beauregard T. Shagnasty, Jan 31, 2010
    #8
  9. 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.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jan 31, 2010
    #9
  10. Matthias Braun

    C A Upsdell Guest

    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.
     
    C A Upsdell, Feb 1, 2010
    #10
  11. 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.
    >
     
    Matthias Braun, Feb 1, 2010
    #11
  12. Matthias Braun

    richard Guest

    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.
     
    richard, Feb 1, 2010
    #12
  13. Matthias Braun

    Andy Dingley Guest

    On 31 Jan, 17: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>
    > (...)


    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.
     
    Andy Dingley, Feb 1, 2010
    #13
  14. 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
     
    Jonathan N. Little, Feb 1, 2010
    #14
  15. 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.
    >
    >
     
    Matthias Braun, Feb 1, 2010
    #15
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tom watson

    print.css and screen.css

    tom watson, Sep 9, 2003, in forum: HTML
    Replies:
    1
    Views:
    501
    Jukka K. Korpela
    Sep 9, 2003
  2. BT
    Replies:
    4
    Views:
    580
    Jan Faerber
    Feb 14, 2005
  3. =?ISO-8859-1?Q?G=E9rard_Talbot?=

    Whining and bitching about MSIE 6 CSS bugs and CSS support

    =?ISO-8859-1?Q?G=E9rard_Talbot?=, Jul 9, 2005, in forum: HTML
    Replies:
    0
    Views:
    439
    =?ISO-8859-1?Q?G=E9rard_Talbot?=
    Jul 9, 2005
  4. Replies:
    3
    Views:
    574
    Steven Cheng[MSFT]
    Oct 9, 2006
  5. Florian Weimer

    Tunneling own XML content in XHMTL etc.

    Florian Weimer, Jan 24, 2011, in forum: XML
    Replies:
    6
    Views:
    1,034
    Florian Weimer
    Feb 5, 2011
Loading...

Share This Page