简体   繁体   English

日语Unicode字符使CSS浮动向左反转

[英]Japanese unicode character is reversing CSS float left

Please check out the following js fiddle in IE (I'm using 10) 请在IE中查看以下js小提琴(我正在使用10)

http://jsfiddle.net/bF65u/1/ 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> 

the radio button divs should be floated left, but they are floating right instead. 单选按钮div应向左浮动,但应向右浮动。 However if I remove that last Japanese character in the 5th radio button it now floats correctly to the left. 但是,如果我在第五个单选按钮中删除了最后一个日语字符,它现在会正确地向左浮动。 This only happens in IE. 这仅在IE中发生。 Can anyone offer a work around? 谁能提供解决方法?

Is it possible you have your browser set to a specific encoding? 是否可能将浏览器设置为特定的编码?

In IE, Go to View -> Encoding click "Auto-Select" and relaod the stylesheet. 在IE中,转到“ View -> Encoding单击"Auto-Select" ,然后重新样式表。

What happens here is not alignment to the right but a disturbance in the alignment to the left: if you add more li elements at the end, they will be properly set. 这里发生的不是右对齐,而是左对齐的干扰:如果在末尾添加更多li元素,则将正确设置它们。

I cannot analyze the ultimate cause of the problem, but it seems to be related to fonts, perhaps due to the fact that IE picks up the Japanese characters from a font other than the one used for texts in general. 我无法分析问题的最终原因,但它似乎与字体有关,这可能是由于IE从通常用于文本的字体之外的一种字体中选取了日语字符这一事实。 This means that the problem can be fixed by setting the font to one that contains the Japanese characters needed, eg 这意味着可以通过将字体设置为包含所需日语字符的字体来解决此问题,例如

li { font-family: MS PGothic; }

In practice, you would need to study which commonly available fonts on Windows contain Japanese characters and write a suitable list, rather than a single font family name, to cover different setups. 在实践中,您需要研究Windows上哪些常用字体包含日语字符,并编写一个合适的列表(而不是单个字体系列名称)来涵盖不同的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM