【问题标题】:CSS text-transform uppercase ignores custom selection stylesCSS 文本转换大写忽略自定义选择样式
【发布时间】:2022-06-11 01:03:27
【问题描述】:

我有一个想要设置样式的元素,我想在first-letter 上设置样式,但是当我这样做并选择文本时,文本选择的颜色会发生变化,我该如何解决?

div::first-letter {
color: red;
text-transform: uppercase;
}

::-moz-selection {
  background-color: rgb(21 174 159 / 0.6) !important;
}

::selection {
  background-color: rgb(21 174 159 / 0.6) !important;
}
<div>some text</div>

【问题讨论】:

  • @Ram 不是“废墟”,它只是忽略选择样式并将其更改为浏览器的默认值

标签: html css


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-02-04
  • 1970-01-01
  • 1970-01-01
  • 2014-08-06
  • 2021-12-26
  • 1970-01-01
  • 2012-08-08
相关资源
最近更新 更多