English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Complete List of CSS Properties

CSS3 justify-Usage and examples of the content property

justify-The content property is used to set or retrieve the alignment of the flexible box element along the main axis (horizontal axis).

The table below provides usage instructions and version history for this property, as well as the syntax for using this property in JavaScript scripts.

Default value:flex-start
Applicable to:Flexible container
Inheritance:None
Animatable:No.See Animation properties.
Version: CSS3new feature
JavaScript syntax:object.style.justifyContent="space-around"

Proof of content usage syntax

The syntax of this attribute is as follows:

justify-content: flex-start | flex-end | center | space-between | space-around | initial | inherit

The following examples demonstrate how to use justify-content attribute.

.flex-container {
      /* Safari */
      display: -webkit-flex;
      -webkit-justify-content: space-around;
      
      display: flex;
      justify-content: space-around;
  }
Test and see‹/›

Attribute value

The table below describes the value of this attribute.

ValueDescription
flex-startThe flexible items are located at the beginning of the container line. This is the default value.
flex-endThe flexible items are located at the end of the line.
centerThe items are located at the center of the container.
space-betweenThe flexible items are evenly distributed along the line.
space-aroundThe flexible items are evenly distributed so that the space between two adjacent items is the same.
initialSet this property to its default value.
inheritIf specified, the associated elements adopt the justify of their parent element-Content attribute values.

Browser compatibility

justify-Browser compatibility of the content attribute, the numbers in the table below represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.

  • FireFox 18+ -moz-,28+

  • Google Chrome 21+ -webkit-,29+

  • Internet Explorer 11+

  • Apple Safari 6.1+

  • Opera 12.1+

Read more

Please refer to the following tutorials:CSS fonts,CSS units,CSS pseudo-elements.

Related properties:align-content,align-items,align-self,display,flex,flex-basis,flex-direction,flex-flow,flex-grow,flex-shrink,flex-wrap,justify-content,min-height,min-width,order.