【问题标题】:css i want to apply style to everything not just bodycss 我想将样式应用于所有内容,而不仅仅是身体
【发布时间】:2021-05-20 09:02:53
【问题描述】:

我想将我的风格应用到所有东西上,而不仅仅是身体

style.css:

body {
    background-color: #3F3F46;
    color: #ffffff;
    cursor: url('https://lelkasa.github.io/cursourcustom.png'), auto;
}

【问题讨论】:

  • 然后使用通用选择器*

标签: css styles


【解决方案1】:

body 替换为html

html {
    background-color: #3F3F46;
    color: #ffffff;
    cursor: url('https://lelkasa.github.io/cursourcustom.png'), auto;
}

您也可以使用*,因为* 选择器会选择所有元素。

* {
    background-color: #3F3F46;
    color: #ffffff;
    cursor: url('https://lelkasa.github.io/cursourcustom.png'), auto;
}

【讨论】:

    【解决方案2】:

    把 CSS 改成:

    html {
        background-color: #3F3F46;
        color: #ffffff;
        cursor: url('https://lelkasa.github.io/cursourcustom.png'), auto;
    }
    

    【讨论】:

      猜你喜欢
      • 2015-08-08
      • 2021-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-14
      • 1970-01-01
      相关资源
      最近更新 更多