1

While we migrate several html pages to websites many pages contain html <center> and <font> tags. which xhtml document type definition should we use?

Either strict, transitional or frameset..?

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
ifaminsi
  • 183
  • 3
  • 20
  • Possible duplicate of [What is DOCTYPE?](http://stackoverflow.com/questions/414891/what-is-doctype) – johnnieb Nov 04 '15 at 04:45
  • @Soorapadman how can you suggest a doctype without having any idea about what's in those files..? – T J Nov 04 '15 at 04:57
  • Why would you want to use a XHTML doctype on a HTML file? Just use a HTML doctype. And if you can't change the `
    ` and `` elements to something sane, it doesn't really matter which. `` will work fine.
    – Mr Lister Nov 04 '15 at 08:30
  • If you want your HTML files to _validate_, use the transitional doctype. (Not the XHTML one though.) However, if validation means you can actually _change_ the sources to adhere to the rules of the validator, do yourselves a favour and get rid of the `
    ` stuff.
    – Mr Lister Nov 04 '15 at 08:32
  • XHTML 1.0 is obsolete. Use HTML 5. If you really want XML (and it is *far* more trouble than it is worth for most people) use the XML serialisation of HTML 5. – Quentin Nov 04 '15 at 08:32

1 Answers1

0

Here is what is at the top of all my pages:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>YOUR TITLE</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="author" content="YOUR URL" />
    <link rel="stylesheet" href="LINKTOYOURCSS.css" 
      type="text/css" media="all" />
    <script type="text/javascript" src="LINKTOYOUR.js">       
    </script>
    </head>
    <body>

After converting:

   <font>
   <center> 

to the css style sheet, I then run the file through the W3C Validator at https://validator.w3.org/. I found that this caught all the old things that I missed and made it easier to identify and correct. I have found that this works the best for me and it passes. Not sure about the others comments. I hope that this answers your question.

C. Fuller
  • 44
  • 7