html - 日文 unicode 字符正在反转 CSS 向左浮动

标签 html css internet-explorer unicode

请在 IE 中检查以下 js fiddle(我使用的是 10)

http://jsfiddle.net/bF65u/1/

.inlineCol2 {
width: 50%;
    }
    .option {
        float: left;
}


<div id="Div_a799f1fc-ccbb-4c85-b367-a20300fe5a64" class="Div_ " >
    <div class="errorMsg"></div>
    <div class="surveyElementContent" title="">
        Why does this '箱' japanese character mess up my floats?
    </div>

    <div class="surveyElementOptions">
         <div class="surveyElementOption option inlineCol2 ">
            <input type="radio" value="1" /> 
            <label>1</label>
        </div>
         <div class="surveyElementOption option inlineCol2">
            <input type="radio" value="2" /> 
            <label>2</label>
        </div>
         <div class="surveyElementOption option inlineCol2">
            <input type="radio" value="3" /> 
            <label>3</label>
        </div>
         <div class="surveyElementOption option inlineCol2">
            <input type="radio" value="4" /> 
            <label>4</label>
        </div>
         <div class="surveyElementOption option inlineCol2">
            <input type="radio" value="5" /> 
            <label>ゴミ箱</label>
        </div>
         <div class="surveyElementOption option inlineCol2">
            <input type="radio" value="6" /> 
            <label>6</label>
        </div>
         <div class="surveyElementOption option inlineCol2">
            <input type="radio" value="7" /> 
            <label>7</label>
        </div>
    </div>
   </div> 

单选按钮 div 应该向左浮动,但它们却向右浮动。但是,如果我删除第 5 个单选按钮中的最后一个日文字符,它现在会正确地向左浮动。这只发生在 IE 中。任何人都可以提供解决方法吗?

最佳答案

这里发生的不是右对齐,而是左对齐的干扰:如果您在末尾添加更多 li 元素,它们将被正确设置。

我无法分析问题的最终原因,但它似乎与字体有关,这可能是因为 IE 从通常用于文本的字体以外的字体中提取日语字符。这意味着可以通过将字体设置为包含所需日文字符的字体来解决问题,例如

li { font-family: MS PGothic; }

在实践中,您需要研究 Windows 上哪些常用字体包含日语字符,并编写一个合适的列表,而不是一个单一的字体系列名称,以涵盖不同的设置。

关于html - 日文 unicode 字符正在反转 CSS 向左浮动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23223650/

相关文章:

css - IE8中的不透明度和元素的小技术问题未显示

javascript - 如何编辑wordpress主题的索引页?

javascript - 将菜单悬停更改为单击/事件 CSS

javascript - bootstrap-wysiwyg 在 IE 中不起作用

html - 为什么填充会影响容器的高度?

jquery - 向下移动所选选项不可见

php - 即(HTTPS): generating pdf from php file doesn't work

javascript - 完全禁用网页滚动

html - 如何使动态大小的表格单元格中的 div 填充单元格

javascript - 使用javascript单击按钮更改div的字体颜色