Content Color of CSS doesn't work on Firefox Printer when we press Ctrl+P

css content image
css content html
css content selector
css after ( content html)
css content: attr
css content not working
how does content work in css
css content before

In Firefox, when I press Ctrl+p to print content Thumb icon in Red Color, Thumb icon printed out in Black Color, could you please help me out?

@media print {
  body {
    -webkit-print-color-adjust: exact;
  }
}

.inner {
  position: relative;
  z-index: 2;
}

#wrap:after {
  content: "\f087";
  font-family: FontAwesome;
  font-style: normal;
  font-weight: normal;
  text-decoration: inherit;
  position: absolute;
  font-size: 40px;
  color: #ff2d00;
  z-index: 1;
}
<HTML>

<head>
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <div id="wrap">
    <div class="inner">
    </div>
  </div>
</body>

</HTML>

I do not have color printing to test but base on spec. can you try to change to this

@media print { * { -webkit-print-color-adjust: exact; printer-colors: exact !important; color-adjust: exact !important; } }

Reference: https://wiki.csswg.org/ideas/print-backgrounds

Supported: Chrome, Firefox, Safari

content attribute text color - css, How do you change the color of a content in CSS? Content Color of CSS doesn't work on Firefox Printer when we press Ctrl+P p to print content Thumb icon in Red Color, important to each css value. Ex: color

Thanks all, I find its solution, in fact we need to configure in "Page Setup" of Firefox is just Tick "Print background (colors & images)" event if we don't set these codes.

@media print {
    * {
       -webkit-print-color-adjust: exact;
        printer-colors: exact !important;
        color-adjust: exact !important;
    }
}

How to Change Website Font Colors With CSS, . It can only be used with the pseudo elements :after and :before. It is written like a pseudo selector (with the colon), but it's called a pseudo element because it's not actually selecting anything that exists on the page but adding something new to the page. CSS Colors. ❮ Previous Next ❯. All modern browsers support the following 140 color names (click on a color name, or a hex value, to view the color as the background-color along with different text colors): For a full overview of CSS colors, visit our colors tutorial.

I think you should mark !important to each css value. Ex: color: #ff2d00 !important; Because we worry about other style already define it as bootstrap.

CSS Content, This outline is different from the border in that it doesn't get space set aside for it in the document (so it may overlap other content). It's generally  CSS Content. CSS has a property called content. It can only be used with the pseudo elements :after and :before. It is written like a pseudo selector (with the colon), but it's called a pseudo element because it's not actually selecting anything that exists on the page but adding something new to the page.

color, This fits with the idea of CSS, in that the HTML content doesn't need to change at a[title]:hover:after { content: attr(title); padding: 4px 8px; color: #333; position:  char css entity name : 0020: space! 0021: exclamation mark " 0022: quotation mark # 0023: number sign $ 0024: dollar sign % 0025: percent sign & 0026: ampersand ' 0027: apostrophe

HTML, We will also assume that you don't want to, or cannot, change the HTML li::​before {content: "•"; color: red; display: inline-block; width: 1em; margin-left: -1em}​. With CSS, a color is most often specified by: a valid color name - like "red" a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" Look at CSS Color Values for a complete list of possible color values.

Applying color to HTML elements using CSS, Gajendar Singh breaks down the CSS content property, with descriptions and demos for all the possible values. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML. w3schools .com THE WORLD'S LARGEST WEB DEVELOPER SITE

Comments
  • Hi Bo SENG, please add some printscreen
  • Can you first try: on your right top menu > click Print to see the preview before? support.mozilla.org/km/kb/how-print-web-pages-firefox
  • I removed your margin, left and top from the css so the icon is visible in the snippet and it doesn't seem to affect your question. If this is incorrect you can undo my change.