:: first-line在Chrome中无法正确定位父第一行,但在Firefox中有效

问题描述

我正在通过不使用任何其他规范来测试:: first-line选择器来查看其工作方式,但是出于某些原因,在Chrome和Edge中,如果li决定不以li的第一行为目标是父母。我在Firefox中对此进行了测试,并且在该网站上可以正常工作。在使这项工作可行的差异中我缺少什么吗?这完全是理论上的,我没有实际用途。以下是一些代码片段供参考。我找不到与查询匹配的任何内容,所以请让我知道。

  ::first-line {
        background-color: red;
    }
  <ul>
            <li>sample child (this does get the property applied)</li>
            <li>sample parent (this does not get the property applied)
                <ul>
                    <li>sample child (this does get the property applied)</li>
                </ul>
            </li>
        </ul>

  

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)