Learn CSS daily

Generate Your Own Playground

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

max-inline-size
.container {
  width: 100%;
  border: 2px solid #007BFF;
  padding: 20px;
  box-sizing: border-box;
}

.content {
  max-inline-size: 300px;
  background-color: #f0f8ff;
  padding: 10px;
  border: 1px solid #007BFF;
  margin: auto;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

The 'max-inline-size' CSS property sets the maximum size of an element in the inline direction, which is typically horizontal in a left-to-right writing mode. This property is useful for controlling the width of elements, allowing for better layout management without explicitly setting a width. It helps maintain responsiveness in designs by limiting the size of text blocks or other inline elements.

max-height
.container { width: 300px; border: 1px solid #ccc; padding: 10px; }
.content { max-height: 100px; overflow: auto; background-color: #f0f0f0; padding: 10px; }

The 'max-height' CSS property sets the maximum height of an element. If the content exceeds this height, it will overflow, allowing you to control how much of the content is visible. This property is particularly useful for creating collapsible sections or limiting the height of images or text blocks.

max-block-size
.container { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; } .box { background-color: #4CAF50; color: white; padding: 20px; max-block-size: 150px; width: 200px; border-radius: 8px; overflow: hidden; height: 300px; }

The 'max-block-size' CSS property defines the maximum size of an element's block dimension, which is the vertical dimension in a block layout (like a column). This property is particularly useful for controlling the height of elements, ensuring they do not exceed a specified size, while allowing them to shrink if necessary. It is often used in responsive design to maintain layout integrity across different screen sizes.

mask-size
.masked-box {
  width: 300px;
  height: 300px;
  background-color: #3498db;
  -webkit-mask-image: url('https://via.placeholder.com/300/ff0000/ffffff?text=Mask');
  mask-image: url('https://via.placeholder.com/300/ff0000/ffffff?text=Mask');
  -webkit-mask-size: 150px 150px;
  mask-size: 150px 150px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

The 'mask-size' property in CSS is used to control the size of the mask applied to an element. It can define the width and height of the mask image, allowing for precise control over how the mask interacts with the element it is applied to. This property is particularly useful for creating complex visual effects and shapes.

mask-repeat
.masked-box {
  width: 200px;
  height: 200px;
  background-color: #3498db;
  -webkit-mask-image: url('https://via.placeholder.com/100');
  mask-image: url('https://via.placeholder.com/100');
  mask-repeat: repeat;
  mask-size: 50px 50px;
  -webkit-mask-repeat: repeat;
  -webkit-mask-size: 50px 50px;
}

The 'mask-repeat' CSS property specifies how a mask image is repeated. It can take values such as 'repeat', 'no-repeat', 'repeat-x', or 'repeat-y' to control the tiling of the mask image. This allows for creative visual effects by controlling the visibility of an element based on the shape defined by the mask.