Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. CSS:层叠样式表
  3. CSS 参考
  4. 选择器
  5. :left

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

:left

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

:leftCSS伪类需要和@ 规则@page 配套使用,对打印文档的左侧页设置 CSS 样式。

css
/* 设置打印时的左侧文档样式 */@page :left {  margin: 2in 3in;}

打印文档的“左”或“右”是由书写方向相关的。举个例子,从左到右的书写方向中第一页应当使用:right 配置;从右至左的书写方向中第一页应当使用:left 配置。

备注:并不是所有样式属性都能应用在此选择器内。仅仅marginpaddingborderbackground 等打印时需要的属性可以使用。其他属性将直接忽略,并且可以使用的属性也只会在打印时生效,显示时不会生效。

参数

Error: could not find syntax for this item

样例

css
@page :left {  margin: 2in 3in;}

规范

Specification
CSS Paged Media Module Level 3
# spread-pseudos

浏览器兼容性

参见

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp