SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Standard xhtml page

    hi.

    im trying to work out a standard page structure that i can use as a template for all design i do. Can anyone check this and suggest improvements pls. Thanks

    HTML Code:
    <!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">
      <!-- Standard xhtml intro -->
      <head>
      
      	<title>Untitled Document</title>
      	
     	<!-- CSS links inc alternative stylesheet. Using import style, then older browsers will display plain html code -->
      	<style type="text/css" media="all">@import "?.css";</style>
     	<link rel="alternate stylesheet" type="text/css" media="all" title="alt stylesheet" href="?.css" />
      	
      	<!-- Meta information -->
      	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      	<meta http-equiv="Content-Language" content="en-us" />
      	<meta name="robots" content="all" />
      	<meta name="author" content=" ADD AUTHOR NAME HERE" />
      	<meta name="Copyright" content="Copyright (c) 2005 AUTHOR NAME" />
      	<meta name="description" content="DESCRIPTION OF THE PAGE HERE" />
      	<meta name="keywords" content="KEYWORDS SEPARATED BY COMMAS" />
      
      </head>
      
      
      
      <body>
      </body>
      </html>
    Last edited by flutlichtjunky; Jul 10, 2005 at 09:17.

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks great; the only problem I have is this:
    HTML Code:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    If you are truly using XHTML, that should be:
    HTML Code:
    <meta http-equiv="Content-Type" content="[b]application/xml+html[/b]; charset=[b]utf-8[/b]" />
    Rather than using a meta element, though (or even along side it), you should be sending the content type on the server side.
    PHP Code:
    header('Content-Type: application/xml+html;'); 
    Code:
    Http.Response('Content-Type: application/xml+html;');
    Code:
    AddType application/xml+html .xhtm
    Note: The ASP and Apache code is probably wrong.
    I will not flame the newbies,
    I will not flame the newbies,
    I will flame the newbies...
    Table free is the way to be!

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks bluedragon for replying.

    Ive seem some articles mentioning that this method isnt so well supported with browsers at the moment, is that true?? And with your method, what happens if your not using a serverside language?

    What is the latest USABLE version of xhtml i should be looking at. xhtml 1.1 strict or xhtml 1.0 strict?

    Thanks

    FJ

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2005
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're quite welcome! Well, this does not work in IE nor any of the older legacy browsers such as NN4. If you don't have a server side language installed, but you are using Apache as your web server, use the third code sample. As far as 1.0S v. 1.1 I still have yet to figure that out.
    I will not flame the newbies,
    I will not flame the newbies,
    I will flame the newbies...
    Table free is the way to be!

  5. #5
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's "application/xhtml+xml", and the META http-equiv is meaningless in XHTML.

    No version of XHTML is usable in IE nor any search engine.

    HTML4 is the latest hypertext markup language with widespread support. HTML4 and XHTML1.0 has the same semantics, and whatever you serve as text/html is treated as HTML4 by user agents, so to me it makes sense to use that.
    Code:
    Content-Type: text/html; charset=utf-8
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html lang="en">
     <head>
      <!-- if you ever tend to use any META http-equiv's, they should go first in HEAD -->
      <title>Untitled document</title>
      <meta name="description" content="">
      <!-- meta keywords is a waste of time, really. -->
      <style type="text/css">@import "/css/";</style>
      <!-- any hacks for IE goes in this separate file :) -->
      <!--[if IE]><link type="text/css" rel="stylesheet" href="/css/ie"><![endif]-->
     </head>
     <body>
      <h1>Untitled document</h1>
     </body>
    </html>
    But of course, IE doesn't treat appendix C compliant XHTML 1.0 served as text/html any worse than HTML4, so in the end I guess it's a personal preference. But if you use XHTML, and want to be "future proof", you should really make sure that you can guarantee well-formedness, and that all works when served as XML.
    Simon Pieters

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    124
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No version of XHTML is usable in IE nor any search engine.
    XHTML 1.0 is, served as text/html.

    WCAG states something along the lines of using the latest usable W3C technology available. XHTML 1.0 Trans/Strict DTD, served as text/html, unless you have some sort of fall back method for user agents that cannot parse the XML correctly *cough*IE.

    Try and avoid <link rel=""> if you plan on allowing NS4 users to access your site as you intend, it just doesn't work. You should use something like;

    Code:
    <style type="text/css">
     @import url(style.css);
    </style>
    There's no need to use IE conditionals if you're including the same CSS file, however, a well built site shouldn't require any seperate CSS rules.

    But if you use XHTML, and want to be "future proof", you should really make sure that you can guarantee well-formedness, and that all works when served as XML.
    Ditto that!
    Equentity, LLC - Coming Soon

    Have a question? Ask here

  7. #7
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XHTML 1.0 is, served as text/html.
    But then of course it isn't XHTML anymore.
    WCAG states something along the lines of using the latest usable W3C technology available.
    HTML4 is the latest usable technology available.

    The @import url(); syntax will make IE4 fetch the stylesheet, the @import ""; syntax doesn't.

    If you have no hacks for IE: Congrats! If you do, you can put them in a separate file that you can be 100% sure only IE will fetch.
    Simon Pieters


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •