IE layers issue when dtd with doctype tag is not added
I am facing a very strange issue because of which when i do not add the below line to the html the layers(z-index) is not working.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"; "_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Please let me know if you are aware of the issue and how to get layers working without adding this tag.
Best Regards, Keshav
Modern versions of IE (7+) have different rendering engines, and choose their rendering engine based on the user's preferences and the page's doctype. So your problem is probably that whatever default rendering engine IE is using when you test your page (probably a compatibility mode) either has a rendering bug or exposes a bug in your mark-up that causes the z-index to not render properly. When you add the doctype, IE changes its rendering engine and the bug in the old rendering engine or your code disappears, so your z-index renders just fine.
There are two ways to fix this:
上一篇: 无法使用JavaScript删除文本框