:第一个字母的伪元素在Firefox中不起作用

时间:2013-01-06 02:14:33

标签: css

无论我做什么,第一个字母伪元素在Firefox中都不起作用。它适用于Chrome,Safari和Opera,但不适用于Firefox。

这是CSS的一部分:

.dyk
{
    font-family: Myanmar Sangam MN;
    line-height: 100px;
    font-weight: 900;
    font-size: 20pt;
    width: 250px;
    position: relative;
    float: left;
}
.dyk:first-letter
{
    font-size: 60px;
}

我尝试过的事情:

  • 验证html和CSS文件
  • CSS重置文件

我一遍又一遍地查看我的代码,但我无法弄清楚是什么问题。

3 个答案:

答案 0 :(得分:0)

好像用户有类似的问题,也许这会有所帮助! ::first-letter pseudo-element not working in firefox

在一个简单的例子中,它有效,希望这会有所帮助:

<style type="text/css">
.dyk {
    font-family: Myanmar Sangam MN;
    line-height: 100px;
    font-weight: 900;
    font-size: 20pt;
    width: 250px;
    position: relative;
    float: left;
}
.dyk:first-letter { font-size: 60px; }
</style>
<div class="dyk">This is a test!</div>

答案 1 :(得分:0)

您可以尝试使用>>> import spacy >>> nlp = spacy.load("en") >>> nlp.vocab["the"].is_stop = False >>> nlp.vocab["definitelynotastopword"].is_stop = True >>> sentence = nlp("the word is definitelynotastopword") >>> sentence[0].is_stop False >>> sentence[3].is_stop True 代替.dyk::first-letter

这就是W3Schools的例子。

答案 2 :(得分:0)

CSS2 中的

:first-letter 或 CSS3 中的 ::first-letter 仅适用于块级元素,不适用于内联元素。例如,如果您尝试在跨度中使用它,则在 Firefox 中将无法使用。您可以在此处详细了解其规格https://drafts.csswg.org/css-pseudo-4/#first-letter-application

相关问题