« カスタムフィールド(Asset)で表示した画像にテキストリンク | メイン | MACのデータをWINで解凍すると文字化けが・・ »

2010年11月17日

背景画像が印刷できない対処法

media="printを指定したら、印刷時に背景が出力されない。

#header{
	margin: 0px;
	padding: 0px;
	height: 170px;
	width:864px;
	background: url(.images/header.jpg) no-repeat;

}

print.cssのこの部分を修正!

#header{
	margin: 0px;
	padding: 0px;
	height: 170px;
	width:864px;
display:list-item;
list-style-image: url(images/header.jpg);
list-style-position: inside;
}

印刷用 CSS の指定で該当箇所を display:list-item; にして、list-style-image に印刷させたい画像を指定する、という事らしい。

参考:

wg:Printing CSS background images (sort of)

lucky bag