I'm currently working on an Angular component called ViewTask, which has a template that is rendered inside the app component. The app component also consists of a side nav bar. My goal is to only display the content inside the 'print-section' div when I print the ViewTask component.
To achieve this, I attempted to use a media query in my style.css file:
@media print {
body {
padding: 2em;
color: #fff;
background-color: red !important;
}
}
However, when I tried printing the page, the styling defined in the media query wasn't applied. I experimented with using @media screen { }, which worked as expected.
Am I overlooking something here? Any assistance on this matter would be highly appreciated.
Thank you!