CSS property page template

Note: Remove this note block before publishing.


Page front matter:

The front matter at the top of the page is used to define "page metadata". The values should be updated appropriately for the particular property.

md
---
title: name-of-the-property
slug: Web/CSS/Reference/Properties/name-of-the-property
page-type: css-property OR css-shorthand-property
status:
  - deprecated
  - experimental
  - non-standard
browser-compat: css.properties.name-of-the-property
sidebar: cssref
---
title

The title value is displayed at the top of the page. The title format is name-of-the-property. For example, the background-color property has a title of background-color.

slug

The slug value is the end of the URL path after https://developer.mozilla.org/en-US/docs/. This will be formatted as Web/CSS/Reference/Properties/name-of-the-property. For example, the slug for the background-color property is Web/CSS/Reference/Properties/background-color. For a multi-word component such as Getting_started in a slug, the slug should use an underscore as in /en-US/docs/Learn_web_development/Core/Structuring_content.

page-type

The page-type value for CSS properties is css-property. For a shorthand CSS property, the value is css-shorthand-property. For example, the page-type value for the animation property is css-shorthand-property because it is a shorthand property, whereas the page-type value for the animation-delay property is css-property.

status

Flags describing the status of this feature. An array which may contain one or more of the following: experimental, deprecated, non-standard. This key should not be set manually: it is set automatically based on values in the browser compatibility data for the feature. See "How feature statuses are added or updated".

browser-compat

Replace the placeholder value css.properties.NameOfTheProperty with the query string for the property in the Browser compat data repo. Check the Other macros in the page section of this note block to see how this key-value is used to generate content for the Specifications and Browser compatibility sections.

This is cssref for all CSS guide and reference pages. See Page structures: Sidebars for details.


Top-of-the-page macros

A number of macro calls appear at the top of the content section (immediately below the page front matter). These macros are automatically added by the toolchain (there is no need to add/remove):

  • {{SeeCompatTable}}: This macro generates an Experimental banner, which indicates that the technology is experimental. If the technology is experimental and is hidden behind a preference in Firefox, you should also fill in an entry for it in the Experimental features in Firefox page.
  • {{Non-standard_Header}} — this generates a Non-standard banner that indicates that the feature is not part of any specification.

You should update or delete the following macros according to the advice below:

Do not provide status header macros manually. Refer to the section "How feature statuses are added or updated" to add these statuses to the page.

Samples of the Experimental, Deprecated, and Non-standard banners are shown right after this note block.


Other macros in the page

  • Formal syntax section: The content for the Formal syntax section is generated using the {{CSSSyntax}} macro. This macro fetches data from the specifications using the @webref/css npm package.

  • Formal definition section: The content for the Formal definition section is generated using the {{CSSInfo}} macro. For this section to have data, you must ensure an appropriate entry has been filled in for the corresponding property in the properties.json data file in the mdn/data repository. See the Properties page for more information.

  • Specifications and Browser compatibility sections: The build tool automatically uses the browser-compat key-value pair from the page front matter to insert data into the Specifications and Browser compatibility sections (replacing the {{Specifications}} and {{Compat}} macros in those sections, respectively).

    Note that you may first need to create/update an entry for the property and its specification in our Browser compat data repo. See our compatibility tables guide for information on adding or editing entries.

Remember to remove this note block before publishing.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Begin the content on the page with an introductory paragraph, which names the property and says what it does. This should ideally be one or two short sentences. All other explanations, if any, should be included in the "Description" section.

Try it

This section is generated by the InteractiveExample macro. This includes the "Try it" section title and the code editor. See the Interactive examples section in our Writing guidelines for more information.

Constituent properties

Add this section only for shorthand properties, such as animation, to list all the related longhand properties.

Introduce the values with one of the following sentences as appropriate:

md
This property is a shorthand for the following CSS properties:

This property is a shorthand for the following logical properties:

This property is a shorthand for the following physical properties:

Reset-only sub-properties

Add this section only for shorthand properties, such as animation, to list all the longhand properties that are reset-only (reset by the shorthand, but not settable by it).

Introduce the properties with the following intro:

md
This property resets the following CSS properties to their initial values:

Syntax

Include the common use cases as a code block and describe the component subvalues that make up a complete value.

css
/* Insert code block showing common use cases */
/* or categories of values */

Values

Include a sentence, like one of the following, to convey how the property's value is constructed:

md
This property is specified as one of the following keyword values:

This property is specified as a single value from the following list:

This property is specified as a space-separated list of the following values:

Follow the sentence with a definition list that includes one term and definition for each subvalue. If an MDN reference page exists for a value type, add that link on the term.

subvalue1

Include a description of the subvalue, its data type, and what it represents.

subvalue2

Include a description of the subvalue, its data type, and what it represents.

Warning: Do not add inline status macros on CSS pages.

Description

Include a description of the property and explain how it works. Use this section to explain related terms and add use cases for the property.

If the property is part of a shorthand, include alternative ways of declaring the value:

md
The `property-name` property, along with the {{cssxref("sibling-property")}} property, can also be set by using the {{cssxref("shorthand-property")}} shorthand.

Formal definition

{{CSSInfo}}

To use this macro, remove the backticks and backslash in the markdown file.

Formal syntax

{{CSSSyntax}}

To use this macro, remove the backticks and backslash in the markdown file.

Accessibility

This is an optional section. Include accessibility guidelines, best practices, and potential concerns that developers should be aware of while using this property. You can also include workarounds or solutions where applicable.

Examples

Note that we use the plural "Examples" even if the page only contains one example.

Add a descriptive heading

Each example must have an H3 heading (###) naming the example. The heading should be descriptive of what the example is doing. For example, "A simple example" does not say anything about the example and therefore is not a good heading. That said, "Basic usage" is acceptable for the first example heading when it only demonstrates value assignment and more complex examples follow. The heading should be concise. For a longer description, use the paragraph after the heading.

See our guide on how to add code examples for more information.

Note: Sometimes you will want to link to examples given on another page.

Scenario 1: If you have some examples on this page and some more examples on another page:

Include an H3 heading (###) for each example on this page and then a final H3 heading (###) with the text "More examples", under which you can link to the examples on other pages. For example:

md
## Examples

### Using the fetch API

Example of Fetch

### More examples

Links to more examples on other pages

Scenario 2: If you only have examples on another page and none on this page:

Don't add any H3 headings; just add the links directly under the H2 heading "Examples". For example:

md
## Examples

For examples of this API, see [the page on fetch()](https://example.org/).

Specifications

{{Specifications}}

To use this macro, remove the backticks and backslash in the markdown file.

Browser compatibility

{{Compat}}

To use this macro, remove the backticks and backslash in the markdown file.

See also

Include links to reference pages and guides related to the current property. Also include a link to the CSS module that the property belongs to. For more guidelines, see the See also section in the Writing style guide.

  • link1
  • link2
  • module_link
  • external_link (year)