开发者

With CSS media print, can I specify the height attribute of an element in inches?

I would like to make开发者_如何转开发 sure the height attribute of an element to be in inches instead of pixels for printing a page using CSS. How can accomplish this?


Css Class:

.class
{
    height: __in;
}

Inline:

<element style="height: __in;"></element>

CSS Values and Units Reference


There's actually an "inch" unit for measurement. Just specify the value in in:

<div id="inches" style="height:1in;"></div>

http://jsfiddle.net/XjZVh/1/

...
<link href=".../print.css" media="print" rel="stylesheet"/>
</head>
<body>
<div id="InchesForPrint"></div>
...

regular css: #InchesForPrint { height:100px; }

print.css: #InchesForPrint { height:5in; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜