XML technologies / CSS / Advanced websites with CSS / CSS property reference / marker-offset

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

If the pseudo-elements :before or :after have their property display set to marker, they are positioned beside the HTML element’s contents: for :before to the left of the first line, and for :after to the right of the last line. The property marker-offset describes the gap between the content and the adjacent element (see the following figure).

The marker-offset property in an HTML element’s box model

Figure: The marker-offset property in the box model of an HTML element.

Note that a pseudo-element has padding and a border but no margin.

Inherited: no

See also: display

Values

Any CSS measurement or the constant auto (the browser determines the gap automatically).

Default value: auto

Compatibility

CSS version: 2

Not supported by any current browser.

Example

The following rule creates quotation marks before and after a blockquote element. The marker-offset setting puts five pixels between the content and quotation marks. If padding were declared for blockquote, its value would increase this gap.

blockquote:before, blockquote:after {
 display: marker;
 marker-offset: 5px;
 content: '"';
 font-size: 150%;
 color: blue;
}

  

 

 

 

back to top