


Print Preview Excludes Background Color
When printing a web page, specified background colors may fail to appear in the print preview. Specifically, a table's assigned background color is not displaying in Chrome's print preview.
The following CSS property has been applied without success:
-webkit-print-color-adjust: exact;
Resolving the Issue
While the CSS property print-color-adjust: exact; functions correctly, there are fundamental troubleshooting steps to ensure the desired CSS takes effect when printing.
-
Separate Print from Screen CSS:
- Implement media queries to distinguish CSS styles for printing (@media print) from those intended for screen display (@media screen).
-
Increased CSS Specificity:
- In this case, the print-color-adjust property is functional, but other CSS rules with higher specificity are overwriting it. To resolve this, use the !important declaration in the @media print rules:
@media print { tr.vendorListHeading { background-color: #1a4567 !important; print-color-adjust: exact; } } @media print { .vendorListHeading th { color: white !important; } }
The above is the detailed content of Why Doesn't My Table's Background Color Show in Chrome's Print Preview?. For more information, please follow other related articles on the PHP Chinese website!

This is the 3rd post in a small series we did on form accessibility. If you missed the second post, check out "Managing User Focus with :focus-visible". In

The CSS box-shadow and outline properties gained theme.json support in WordPress 6.1. Let's look at a few examples of how it works in real themes, and what options we have to apply these styles to WordPress blocks and elements.

This tutorial demonstrates creating professional-looking JavaScript forms using the Smart Forms framework (note: no longer available). While the framework itself is unavailable, the principles and techniques remain relevant for other form builders.

This article explores the top PHP form builder scripts available on Envato Market, comparing their features, flexibility, and design. Before diving into specific options, let's understand what a PHP form builder is and why you'd use one. A PHP form

If you’ve recently started working with GraphQL, or reviewed its pros and cons, you’ve no doubt heard things like “GraphQL doesn’t support caching” or

The Svelte transition API provides a way to animate components when they enter or leave the document, including custom Svelte transitions.

How much time do you spend designing the content presentation for your websites? When you write a new blog post or create a new page, are you thinking about

In this article we will be diving into the world of scrollbars. I know, it doesn’t sound too glamorous, but trust me, a well-designed page goes hand-in-hand


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
