우리 회사는 인쇄용으로 print.css를 사용하고 있습니다. 또한 print.css를 비롯한 다른 .css 파일을 무시하는 또 다른 style.css가 있습니다. 어떤 이유로 html5 상용구 (재정의 파일에 있음)의 @media 인쇄 쿼리가 켜져있을 때 IE8과 IE9가 빈 페이지를 인쇄합니다. 댓글을 달았을 때 아무런 문제가 없습니다. 여기서 문제는 무엇입니까? 우리는 상용구에서 @media 인쇄물을 남기고 싶습니다.IE는 CSS에서 빈 페이지를 인쇄합니다. 보일러 플레이트
PRINT.CSS
@media print
{
body *
{
visibility:hidden;
}
#basicShell #main,
#basicShell #main *,
.basicShell_container .content,
.basicShell_container .content *,
#mainShell_container .center_columnContent,
#mainShell_container .center_columnContent *
{
visibility:visible;
}
#basicShell #main,
.basicShell_container .content,
#mainShell_container .center_columnContent
{
position:absolute;
left:0;
top:0;
}
}
있는 style.css는
@media print {
* { background: transparent !important; color: black !important; text-shadow: none
!important; filter:none !important; -ms-filter: none !important; float: none
!important;} /* Black prints faster: h5bp.com/s */
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /*
Don't show links for images, or javascript/internal links */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } /* h5bp.com/t */
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}
또한 규칙이 사용되는 이유는 무엇입니까? 당신은 그것을 삭제할 수 있으며 모든 것이 잘 될 것입니다. –
이 규칙은 모든 요소를 숨김으로써 특정 요소 만 표시 할 수 있습니다 (예 : 인쇄물에 선택 목록을 표시하고 싶지 않음). – dudeNumber4