CSS/SCSS/bootstrap ::覆盖打印设置在bootstrap ::更改背景:透明!重要的颜色

前端之家收集整理的这篇文章主要介绍了CSS/SCSS/bootstrap ::覆盖打印设置在bootstrap ::更改背景:透明!重要的颜色前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个引导CSS /打印的问题。

在引导CSS(reset.css)中,所有内容都被清除以进行打​​印

  1. @media print {
  2. * {
  3. text-shadow: none !important;
  4. color: black !important;
  5. background: transparent !important;
  6. Box-shadow: none !important;
  7. }
  8. }

但是我必须打印几行颜色。我的表看起来像这样:

  1. <div class="container">
  2. <div id="task-summary">
  3. <div id="process-summary">
  4. <table class="table table-condensed">
  5. <tbody>
  6. <tr class="success">
  7. <td>

我将其嵌入到我的代码中,但它不起作用:

  1. @media print {
  2.  
  3. #task-summary{
  4. .success{
  5. background-color: #DFF0D7 !important;
  6. }
  7. }
  8. }

我已经尝试过,如果css被除了使用display:none ..它的作品(行不显示),似乎在正确的地方。

有人有一个想法,我如何可以设法覆盖bootstrap css命令,而不必编辑boot.cap的引导?

问Jabbawock

这是我在stackoverflow上的第一篇文章,所以对于更好的帖子的任何建设性的评论也是非常感激的。

解决方法

  1. @media print {
  2. .success {
  3. background-color: #DFF0D7 !important;
  4. }
  5. }

要么

  1. @media print {
  2. #task-summary .success {
  3. background-color: #DFF0D7 !important;
  4. }
  5. }

要么

  1. @media print {
  2. #task-summary > #process-summary .success {
  3. background-color: #DFF0D7;
  4. }
  5. }

猜你在找的CSS相关文章