Tuesday, 2 August 2022

Margin bottom not getting applied in the Print window in Angular

I have running Angular 12 application and I have integrated print functionality. I don't want to display header and footer in the print page, so I have added margin:0; I have added margin in the body, but somehow only margin-top is getting applied and not the margin-bottom.

Is there any way to add margin-bottom for every page.

Stackblitz code: https://stackblitz.com/edit/angular-ivy-oufgr5?file=src%2Fapp%2Fapp.component.html

styles.scss

@media print {
  @page {
    margin: 0;
  }

  body {
    padding-top: 1in !important;
    padding-bottom: 1in !important;
    padding-left: 0.3in !important;
    padding-right: 0.3in !important;
  }
}

enter image description here



from Margin bottom not getting applied in the Print window in Angular

No comments:

Post a Comment