Learn CSS daily

Generate Your Own Playground

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

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.

margin-block
.container {
  background-color: lightblue;
  padding: 20px;
  text-align: center;
}

.title {
  margin-block: 30px;
  font-size: 2em;
}

.description {
  margin-block: 20px;
  font-size: 1.2em;
}

The 'margin-block' property in CSS allows you to set the vertical margins (top and bottom) of an element in a single declaration. This property is particularly useful for controlling spacing in a block-level context, making it easier to manage layout and improve readability. It simplifies the syntax and enhances maintainability by reducing the number of individual margin properties you need to manage.

margin
.container { background-color: lightblue; padding: 20px; }
.title { margin-bottom: 20px; color: darkblue; }
.description { margin: 40px; color: darkgreen; }

The 'margin' property in CSS is used to create space around elements, outside of any defined borders. It can accept values in different units such as pixels, ems, or percentages, and can be applied to all four sides of an element (top, right, bottom, left) individually or collectively. This property is crucial for controlling layout and spacing in web design.

list-style-type
.custom-list {
    list-style-type: square;
    padding: 20px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

.custom-list li {
    margin: 5px 0;
    font-size: 18px;
}

The 'list-style-type' CSS property specifies the type of marker to use for list items in ordered and unordered lists. This property allows you to customize the appearance of bullet points or numbering in lists, enhancing the visual presentation and structure of content.