Learn CSS daily

Generate Your Own Playground

Type any CSS property and get a live, editable playground instantly.

margin-inline-end
.container {
  display: flex;
  justify-content: space-between;
  padding: 20px;
  background-color: #f0f0f0;
}

.box {
  background-color: #4CAF50;
  color: white;
  padding: 20px;
  margin-inline-end: 20px;
}

.box:last-child {
  margin-inline-end: 0;
}

The 'margin-inline-end' CSS property sets the margin space on the end side of an element in a block container, which is determined by the text direction (left for left-to-right and right for right-to-left). This property is useful for creating responsive layouts that adapt to different writing modes without needing to change the margin values manually.

margin-inline
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.box {
  background-color: #4CAF50;
  color: white;
  padding: 20px;
  margin-inline: 15px;
  border-radius: 5px;
  text-align: center;
}

The 'margin-inline' CSS property sets the margin on the inline start and inline end sides of an element. This property is particularly useful for controlling the horizontal spacing in a layout, especially in languages that are written from left to right or right to left. By using 'margin-inline', you can easily adjust the spacing without having to specify separate values for left and right margins.

margin-bottom
.box { background-color: lightblue; padding: 20px; margin-bottom: 20px; border: 1px solid blue; }

The 'margin-bottom' property in CSS is used to create space below an element. This space is outside the element's border and can help to separate elements vertically, improving the layout and readability of the content on a webpage.

margin-block-start
.container {
  background-color: #f0f0f0;
  padding: 20px;
  border: 1px solid #ccc;
}

.title {
  margin-block-start: 40px;
  color: #333;
}

the.description {
  color: #666;
}

The 'margin-block-start' property in CSS is used to set the margin space at the start of a block-level element, which is typically the top margin in a vertical writing mode. This property allows for better control of the layout, especially in responsive designs, by adjusting the spacing around elements without affecting other dimensions.

margin-block-end
.container {
  background-color: #f0f0f0;
  padding: 20px;
  border: 1px solid #ccc;
}

.title {
  color: #333;
  margin-block-end: 30px;
}

description {
  color: #555;
  margin: 10px 0;
}

The 'margin-block-end' CSS property sets the margin area on the end side of the block-level element, which is determined by the writing mode. This property is useful for controlling the spacing between elements in a vertical layout, allowing for better control over the design and flow of content.