css - bootstrap中CSS代码中--blue的作用是什么?

标签 css

<分区>

bootstrap中CSS代码中的“--blue”有什么作用?如果更改默认颜色值,我在哪里可以找到引用?

:root {
  --blue: #007bff;
  --indigo: #6610f2;
  --purple: #6f42c1;
  --pink: #e83e8c;
  --red: #dc3545;    
}

最佳答案

这些是 Custom Properties也称为 CSS 变量,可以使用 var() 函数在您的 CSS 文件中使用。

来自 MDN

Property names that are prefixed with --, like --example-name, represent custom properties that contain a value that can be used in other declarations using the var() function.

关于css - bootstrap中CSS代码中--blue的作用是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54464242/

上一篇:jquery - 单击更改元视口(viewport)内容

下一篇:css - 使用媒体查询时 Div 不适合浏览器的宽度

相关文章:

javascript - 打开和关闭 Div 元素时添加动画

html - 为什么我的背景图片会出现在 Chrome 而不是 IE?

php - autoprefixer PHP 无法正常工作,如示例所示

c# - 需要在每个浏览器中显示相同的 Div 高度

javascript - 使 Canvas 游戏响应调整大小

html - CSS3 视差滚动

c# - 使用javascript启用文本框

jquery - 无法使用选择器关闭 div

html - 包含悬停操作的复杂 div 集的定位问题?

css - SCSS 中创建-扩展类名的未知@规则?