@page.size

@page.size

这是一种实验技术

由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。另外请注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。

与at规则一起使用的size CSS规则描述符@page定义了用于表示页面的框的大小和方向。大多数情况下,这个尺寸对应于打印页面的目标尺寸(如果适用的话)。

大小可以用“可缩放”关键字来定义(在这种情况下,页面将填充可用的尺寸)或绝对尺寸。

在数据库中找不到值!

语法

/* Keyword values for scalable size */ size: auto; size: portrait; size: landscape; /* <length> values */ /* 1 value: height = width */ size: 6in; /* 2 values: width then height */ size: 4in 6in; /* Keyword values for absolute size */ size: A4; size: B5; size: JIS-B4; size: letter; /* Mixing size and orientation */ size: A4 portrait;

auto用户代理决定页面的大小。在大多数情况下,使用目标板的尺寸和方向。

实例

@page { size: 4in 6in landscape; }

规范

SpecificationStatusComment
CSS Paged Media Module Level 3The definition of 'size' in that specification.Working DraftInitial definition

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support?????

FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic support?????