开发者

IE8 - Chinese Chars - Strict vs. Transitional Doctype

开发者 https://www.devze.com 2023-03-09 16:10 出处:网络
Redesigning a website I\'ve moved from <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">

Redesigning a website I've moved from

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

doctype to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
    "http://www.w3.org/TR/html4/strict.dtd">

doctype.

My content-type meta tag is:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Unfortunately, in IE8, chinese characters now show up as blank squares. Reverting to the transitional doctype solves the issue, as does adding the following directive:

<meta http-equiv="X-UA-Compatible" content="IE=7" />
开发者_StackOverflow社区

Is there another way of solving it without sacrificing proper IE8 rendering?

Edit:

Here's a minimal example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body><a href="#">片瓜片南語</a></body>
</html>

If I remove the doctype it displays ok

0

精彩评论

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

关注公众号