为什么浏览器视图元素标题标签的格式不正确?

时间:2012-10-15 11:25:10

标签: html xhtml

  

可能重复:
  img title attribute displaying blocks instead of foreign characters

我正在处理一个案例,我必须在元素上设置工具提示以显示中文。我已将页面XHTML语言属性设置为zh-CN和元素标题标签,如下所示:

<div class="cleditorButton" title="字体颜色" style="background-color: transparent; background-position: -216px 50%; "></div>

但是当我将鼠标悬停在标题上时,标题的格式不正确。

enter image description here

这是因为我的电脑上没有安装中文字体吗?

2 个答案:

答案 0 :(得分:1)

将charset设置为utf-8,在你的meta中会是这样的。

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

答案 1 :(得分:0)

您可以参考this site获取更精彩的答案

这将解释浏览器视图元素