:left CSS Pseudo Class

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

Description

The CSS :left pseudo-class is used with the @page at-rule to select all left-hand pages of a printed document. Whether a given page is "left" or "right" is determined by the major writing direction of the document.

For example, the following CSS will style the left margin of all left-hand pages to be 1 inch:

@page :left {
margin-left: 1in;
}

You can also use the :left pseudo-class to style other properties of left-hand pages, such as the padding, border, and background.

It is important to note that the :left pseudo-class can only be used to style the page box. This means that you cannot use it to style elements on the page, such as paragraphs, headings, or images.

Here is an example of how to use the :left pseudo-class to style the background of all left-hand pages:
@page :left {
background-color: lightblue;
}

This will make all left-hand pages have a light blue background.

The :left pseudo-class can be a useful tool for styling printed documents. By using it, you can create different styles for left-hand and right-hand pages, or for even and odd pages.

Syntax

:left {
  /* ... */
}

Example

No example, see CSS tab for code example.
@page :left {
margin: 2in 3in;
}

Browser Support

The following table will show you the current browser support for the CSS :left pseudo class.

Desktop
Edge Chrome Firefox Opera Safari
126x9.25
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
18x10.14.2137

Last updated by CSSPortal on: 1st October 2023