gpt4 book ai didi

html - overflow hidden 时的 Firefox 文本缩进错误

转载 作者:太空狗 更新时间:2023-10-29 14:18:08 25 4
gpt4 key购买 nike

实际上我有一个进度条,它使用文本缩进在进度中间放置一些文本。

在 Chrome 和 IE 中都可以正常工作,但在 Firefox 中不行。 (是的,我简直不敢相信)

检查 Chrome 和 Firefox 的区别。

http://jsfiddle.net/ZGyaz/1/

动画版

http://jsfiddle.net/ZGyaz/19/

HTML

<div class="container">
<div class="bars bar1">sametext</div>
<div class="bars bar2">sametext</div>
</div>

CSS

.container{
border:1px solid #09c;
height: 20px;
width: 100%;
position: relative;
}

.container .bars{
text-indent: 45%;
position: absolute;
top:0;
font-family: arial;
color: #09c;
}

.container .bar2{
background-color: #09c;
width: 50%;
color: #fff;
overflow: hidden;
}

bar2 中的宽度和文本缩进是动态变量,用于显示填充进度条时的预期结果。

最佳答案

这看起来像是一个以前未报告的 Gecko 错误。我提交了 https://bugzilla.mozilla.org/show_bug.cgi?id=908706

作为解决方法,您是否可以使用不是百分比的文本缩进值?

关于html - overflow hidden 时的 Firefox 文本缩进错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18405604/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com