- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在研究 Bootstrap 4 中的表格。我不知道为什么不应用台灯类中的背景颜色。这是因为台灯无法覆盖暗灯吗?如果是真的,你能告诉我是什么让 thead-dark 优先于此吗?如果不是我想的,请为我解释背后的原因。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
<title>Table</title>
</head>
<body>
<div class="container">
<h2>Contextual Classes</h2>
<p>Contextual classes can be used to color the table, table rows or table cells. The classes that can be used are: .table-primary, .table-success, .table-info, .table-warning, .table-danger, .table-active, .table-secondary, .table-light and .table-dark:</p>
<table class="table">
<thead class="thead-dark">
<tr>
<th class="table-light">Firstname</th>
<th>Lastname</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>Default</td>
<td>Defaultson</td>
<td>def@somemail.com</td>
</tr>
<tr class="table-primary">
<td>Primary</td>
<td>Joe</td>
<td>joe@example.com</td>
</tr>
<tr class="table-success">
<td>Success</td>
<td>Doe</td>
<td>john@example.com</td>
</tr>
<tr class="table-danger">
<td>Danger</td>
<td>Moe</td>
<td>mary@example.com</td>
</tr>
<tr class="table-info">
<td>Info</td>
<td>Dooley</td>
<td>july@example.com</td>
</tr>
<tr class="table-warning">
<td>Warning</td>
<td>Refs</td>
<td>bo@example.com</td>
</tr>
<tr class="table-active">
<td>Active</td>
<td>Activeson</td>
<td>act@example.com</td>
</tr>
<tr class="table-secondary">
<td>Secondary</td>
<td>Secondson</td>
<td>sec@example.com</td>
</tr>
<tr class="table-light">
<td>Light</td>
<td>Angie</td>
<td>angie@example.com</td>
</tr>
<tr class="table-dark text-dark">
<td>Dark</td>
<td>Bo</td>
<td>bo@example.com</td>
</tr>
</tbody>
</table>
</div>
</body> <!-- source: https://www.w3schools.com/bootstrap4/bootstrap_tables.asp -->
问题:
最佳答案
这就是.thead-light
在 Bootstrap stylesheet 中定义.
.table .thead-light th {
color: #495057;
background-color: #e9ecef;
border-color: #dee2e6;
}
你看到它的目标是th
元素是具有 thead-light
的元素的后代类。
因此,当您将该类应用于 th
时元素,就像你在
<th class="table-light">Firstname</th>
你需要定位
th.thead-light {
/* CSS */
}
否则.table-dark > th
的特异性将覆盖 <th class="table-light">
的那个
.table-dark,
.table-dark > th, /* <<< This rule */
.table-dark > td {
background-color: #c6c8ca;
}
关于html - 上下文类不能覆盖表头颜色类 (.thead-dark/.thead-light),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48854687/
我正在将现有应用调整为深色模式。 某个 View 使用图像来表示特征的状态。我选择了 Assets 目录中的图像并将其 Appearances 字段从无修改为 Any, Dark。然后我为 Dark
所以我有一个应用程序是 Holo Light with Dark Actionbar,每当我在 EditText 中复制和粘贴某些内容时,图标都是白色的,因此您看不到它们。屏幕截图位于下方。有什么办法
我有 Firefox 69, 激活暗模式时,newtab 页面保持亮起。 我通过 about:config?filter=browser.in-content.dark-mode 激活了暗模式(改为
我正在使用 Ubuntu 并尝试通过使用 matchMedia 获得用户的首选主题但它总是返回 false对于这个查询。 window.matchMedia('(prefers-color-schem
我正在使用从 SVG 文件导入为矢量绘图的用户个人资料头像。我还将我的主题扩展到 Material 主题 Theme.MaterialComponents.DayNight.NoActionBar。但
我一直在查看 Dark Reader 扩展的源代码。 https://github.com/darkreader/darkreader我找不到负责在网页右侧生成黑色滚动条的代码或函数。它位于哪个文件中
在vim中,我可以运行set bg=dark,然后vim将调整所有语法突出显示以在具有深色背景的终端上工作(无论背景是否实际上是深色的,vim都将其假定为深色)。 我如何告诉emacs假定背景是黑暗还
我今天升级了 Pycharm2016.1,并希望将主题更改为 Solarized Dark,但我看不到更改/添加的选项。有人尝试用 Pycharm2016.1 做同样的事情吗? 最佳答案 this G
我目前正在使用带深色操作栏的 Holo 灯,我想更改我的应用以完全使用 Holo。我从 更改了 styles.xml ""到 "" 我在 values-14 内更改了 styles.xml ""到 "
目标: 将主题更改为“UI darkness” 问题: 根据下面的代码,我不知道该怎么做。 $(function() { $( "#from").datepicker({ show
我最近想让我的状态栏颜色渐变。我知道 WindowManager 方式是如何工作的。但我决定另辟蹊径,用渐变色为状态栏上色。 所以我这样做了, #3F51B5 @drawable/
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 5 年前。 Improve
我使用的是TailWind 3.3.2和Next.js 13.4.4。在我的网站上。我没有实现黑暗模式,一切对我来说都运行得很好。我在笔记本电脑和移动设备上使用不同的浏览器(Chrome、Firefo
好像大概也许是一年前, mac os系统发布了深色模式外观, 看着挺刺激, 时至今日用着也还挺爽的 终于, 随着iphone11等新手机的发售, ios 13系统也正式发布了, 伴随着手机版的深色
我正在使用 following css使用 @media(prefers-color-scheme: dark) 以便向在操作系统级别选择暗模式的用户显示暗站点版本。当我通过 Windows 切换深色
我可以得到UI_MODE_NIGHT_MASK调用 resources.configuration.uiMode和 Configuration.UI_MODE_NIGHT_MASK . 我需要听这个变
在使用冰柱很长时间后,我正在尝试使用 Helm 。 大多数时候我默认使用流行的日光深色配色方案,而 helm 似乎选择了特别难以理解的颜色: ...我如何建议 helm 选择更有用的颜色?希望当我切换
在开发菜单栏应用程序时,我很难找到使该应用程序看起来更好的首选方法。我本来以为Apple控件基本上可以解决此问题,但事实并非如此。 确保菜单栏应用在亮模式和暗模式下都看起来不错的首选方法是什么?我是否
经过研究,我发现Qt 5现在提供了一个所谓的Fusion主题,该主题被描述在他们的blog posts中。我非常喜欢您可以在上一张图片中看到的带有黑色配置的主题,并且我想在我的应用程序中使用它,但是似
我在 Mac 上启用了暗模式,但在带有 ckeditor 的 django 管理面板中看起来很尴尬。是否可以在 Chrome 或 Django 管理员中禁用它?我已经尝试过主题和浏览器扩展,但没有成功
我是一名优秀的程序员,十分优秀!