开发者

IE9 (ie) Compatibility mode is breaking "select"

开发者 https://www.devze.com 2023-03-16 14:54 出处:网络
This is a real head scratcher for me. Our site (amy开发者_运维问答adele.com/labels/holiday-and-seasonal/…), has a price drop down in the right hand sidebar. In every browser except IE, the pricing dr

This is a real head scratcher for me. Our site (amy开发者_运维问答adele.com/labels/holiday-and-seasonal/…), has a price drop down in the right hand sidebar. In every browser except IE, the pricing drop down works. When you view it in ie, the drop down does not show anything. I used i9 just recently, and if I force ie9 out of compatibility mode, the drop down works.

Does anybody know a solution to this, or see what might be causing this issue?


Force IE into standards mode by starting the document with <!DOCTYPE html>, and out of compatibility mode by adding <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> in the <head>.

Seriously, in Quirks mode a browser is basically allowed to draw a sad kitten instead of your website.


Try changing your DOCTYPE tag from

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

to

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

Also, don't confuse Browser Mode and Document Mode. In IE if you F12 (Developer tools) and try different combinations from the 2 menus once the page is loaded. Your 'select' works fine for me with Browser Mode: 'IE9 Compat View' and Document Mode: anything other than Quirks.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号