【问题标题】:CSS3 ::selection doesn't cover entire page [duplicate]CSS3 ::selection 不覆盖整个页面[重复]
【发布时间】:2014-07-12 12:57:27
【问题描述】:

我目前正在做一个网店,我正在使用以下 CSS3 通过以下 CSS 更改所选内容的样式:

::selection {
    background-color:#5f2f8f;
    color:white;
}

它确实有效,但是当我按下 CTRL+A 时,您仍然会在某些空格(蓝色的东西)上看到 default 选择。

为什么在按CTRL+A后某些空格还是默认选择样式?

Live demo

图片演示:

【问题讨论】:

  • 这主要是因为::selection的浏览器实现很差。
  • @BoltClock,我不会说穷。为什么你应该能够突出边距和内边距?

标签: html css


【解决方案1】:

问题重复:Why does the CSS3 pseudo ::selection not change the color for all parts?

他说!

我能想出的唯一解决方法是使用 “contenteditable”元素而不是“<input>”元素。

原帖来自:“ThinkingStiff”

请务必查看他的完整帖子:CSS3 - How to style the selected text in textareas and inputs in Chrome?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-20
    • 1970-01-01
    • 2020-04-17
    • 2016-08-28
    • 1970-01-01
    • 2017-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多