CSS shape-margin Property

❮ Previous Reference Next ❯

Example

section {
  max-width: 400px;
}

.shape {
  float: left;
  width: 150px;
  height: 150px;
  background-color: #336699;
  clip-path: polygon(0 0, 150px 150px, 0 150px);
  shape-outside: polygon(0 0, 150px 150px, 0 150px);
  shape-margin: 20px;
}

Meaning:

The shape-margin CSS property sets a margin for a CSS shape created using shape-outside.

Default value:0
Inherited:No
Animatable:No
Version:CSS3
JavaScript syntax:
object.style.shapeMargin="[length|percentage]|initial|inherit|revert|revert-layer|unset";



Standard Syntax

shape-margin: [length|percentage]|initial|inherit|revert|revert-layer|unset;



Browser Support




Status







Property Values

The following table describes the values of this property:

Value Description
[length|percentage] Sets the margin of the shape to a length value or to a percentage of the width of the element's containing block.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.



Default CSS Property Values

selectors {
  shape-margin: 0;
}
❮ Previous Reference Next ❯