What throws Internet Explorer into quirks mode?

前端 未结 4 592
再見小時候
再見小時候 2020-12-18 20:38

I have created a webpage (http://www.snow4life.yum.pl) that was rendered properly in firefox, chrome etc. Of course dumb IE complicated things, because it e

相关标签:
4条回答
  • 2020-12-18 21:08

    I added both the doctype from the first comment and then the meta tag and it worked thanks guys .... and no thanks to IE :(

        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    

    and

        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    

    I have just changed the doctype to html5 and it still works great

     <!DOCTYPE html> 
        <html>
          <head> 
            <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    0 讨论(0)
  • 2020-12-18 21:09

    Paste the below code within the head tag

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    0 讨论(0)
  • 2020-12-18 21:11

    Try killing all the whitespace before the DOCTYPE.

    EDIT: There is an <feff> character which is a Unicode BOM signature at the start of the file. Since you may not have a text editor that can actually see that, try deleting the entire first line and paste over it with

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    

    And do NOT save the file with a BOM unicode signature. If this doesn't work, try a different text editor altogether.

    0 讨论(0)
  • 2020-12-18 21:21

    Quirks mode in any version of IE will also be triggered if anything precedes the DOCTYPE. For example, if a hypertext document contains a comment, space or any tag before the DOCTYPE declaration, IE will use quirks mode:

    <!-- This comment will put IE 6, 7, 8, and 9 in quirks mode -->
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    
    0 讨论(0)
提交回复
热议问题