내가 아주 간단한 HTML이 인쇄에 몇 가지 문제를 해결하는 방법 :아주 기본적인 HTML
<div id="advisor">
<div id="print_this_container">
<form>
<input type="button" value=" Print this page "
onclick="window.print();return false;" />
</form>
</div>
<div id="top_section">
<div class="left_box" style="position: relative;">
<div id="avatar_container">
<img class="avatar" src="<%= @advisor.avatar_url %>" />
</div>
</div>
<div class="right_box">
<h2><strong>Council on Emerging Markets</strong></h2>
</div>
</div>
</div>
연관된 CSS는 다음과 같습니다
#advisor{
width: 800px;
}
#top_section{
border-bottom: 1px solid #666 !important;
height: 200px;
}
.right_box{
float: left;
padding-left: 25px;
padding-top: 50px;
width: 550px;
}
.left_box{
background: #ccc;
width: 200px;
float: left;
text-align: center;
height: 100%;
}
img.avatar{
width: 150px;
}
그리고 내 print.css의를
#advisor{
width: auto;
}
#print_this_container{
display: none;
}
내 웹 페이지에서 멋지게 보입니다. 나는 그것을 인쇄 할 때, 다음과 같은 문제가 발생합니다
이- 윗부분 테두리 이미지가 오른쪽 상자에 왼쪽 상자에 표시됩니다
- 축소
- 사라는 뜨지 않습니다
- 왼쪽 상자 배경색 가 사라짐
누구든지 이러한 문제를 해결하는 방법을 알고 있습니까?
이 어떻게 인쇄 스타일 시트를 연결하고 브라우저 호환성 차트를 살펴 Here 및 Here 일부 솔루션 및 Here을 가진 시도? 대부분의 브라우저에서는 배경이 인쇄되지 않는다는 점에 유의하십시오. –
스타일 시트를 잡아 먹고 있습니다 – Tony