css中的省略号适用于Firefox(16.0.2),但不适用于Chrome(22.0.1229.94)

Geo*_*hos 10 css google-chrome ellipsis css3

我有以下html:

<div class="x">
    <div class="y" title="aaaaa">
        <a href="/">
            aaaaa
        </a>
    </div>
    <div class="y" title="bbbbbb">
        <a href="/">
           bbbbbb
        </a>
    </div>
    <div class="y" title="ccccc">
        <a href="/">
            ccccc
        </a>
    </div>
    <div class="y" title="dddddddd">
        <a href="/">
            dddddddd
        </a>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

用css:

.x{
    width: 10em;
    background-color: #FFB9B9;
    white-space: nowrap;
    overflow: hidden; 
    text-overflow: ellipsis;
}
.y {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    line-height: 18px;
    white-space: nowrap;    
    background-color: #E1CECE;
    display: inline-block;
}
Run Code Online (Sandbox Code Playgroud)

你可以在这里看到:http://jsfiddle.net/fDBbm/

省略号从一开始就在Firefox(16.0.2)中工作,但在Chrome(22.0.1229.94)中没有.

tw1*_*w16 5

这是一个源于使用display:inline-block和的错误text-overflow: ellipsis.不幸的是,当配对/使用时,Chrome无法正确处理属性.

几个月前报告了该错误:http://code.google.com/p/chromium/issues/detail?id = 133700