<?xml version="1.0" encoding="utf-8"?>

Discussion in 'HTML & Website Design' started by ddzc, Nov 22, 2008.

  1. #1
    Hi all,

    I have a template from templatemonster. On the html pages, the first line is
    <?xml version="1.0" encoding="utf-8"?>

    I added a piece of code to my .htaccess to allow php in html files. Since then, none of my sites operate (gives an errors on line 1). Once I remove the above line, the pages function and I notice nothing different. I tried in 2 browsers, nothing was edited or aligned or changed with the removal of that line. What is it used for?

    Thanks
     
    ddzc, Nov 22, 2008 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    That is the xml declaration. Since XHTML is XML, technically that line is to be there. However, almost everyone serves xhtml as html, so it's not needed. In addition, only modern browsers can handle it anyway, so IE<7 goes into quirks mode, and IE7 just ignores it. You can safely remove the line.
     
    drhowarddrfine, Nov 22, 2008 IP