gpt4 book ai didi

html - 为什么设置 :first-letter selector with whitespace cause mouse highlighting to be offset?

转载 作者:太空狗 更新时间:2023-10-29 16:40:05 27 4
gpt4 key购买 nike

有一个问题,通过添加空格我得到以下突出显示的偏移量异常。这真的是预期的行为吗?

这似乎影响了 Chrome/Safari

Highlighting weirdness

问题重现于此:https://jsfiddle.net/qsa99cc6/

CSS:

p:first-letter {
text-transform: uppercase;
}

HTML:

<p>
highlight me! this won't work because there's whitespace in the &lt;p&gt;
</p>

<p>highlight me! This should work because there isn't</p>

最佳答案

它的行为在不同的浏览器上是不同的。所以它也可能是浏览器中的某种错误。也许那些浏览器识别伪元素 :first-letter 的方式与伪元素 :before:after 相同。

关于html - 为什么设置 :first-letter selector with whitespace cause mouse highlighting to be offset?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32990392/

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