Learn CSS daily

Generate Your Own Playground

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

justify-content
.container { display: flex; justify-content: space-between; background-color: #f0f0f0; padding: 20px; } .item { background-color: #4CAF50; color: white; padding: 10px; margin: 5px; border-radius: 5px; }

The 'justify-content' property in CSS is used to align flex items along the main axis of a flex container. It helps distribute space between items and can control their alignment in various ways, such as centering them, spacing them out evenly, or aligning them to one end.

isolation
.container { position: relative; width: 300px; height: 200px; } .background { background-color: rgba(255, 0, 0, 0.5); width: 100%; height: 100%; position: absolute; top: 0; left: 0; } .foreground { isolation: isolate; background-color: rgba(0, 255, 0, 0.8); padding: 20px; position: relative; z-index: 1; }

The CSS 'isolation' property controls the blending context of an element. When set to 'isolate', it creates a new stacking context, which can help in managing overlapping elements and their visual effects, particularly when using opacity or mix-blend-mode. This property is useful for ensuring that certain elements are visually distinct from others in terms of rendering and interactions.

inset-inline-start
.container { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; } .box { width: 200px; height: 100px; background-color: #4CAF50; color: white; display: flex; justify-content: center; align-items: center; position: relative; inset-inline-start: 50px; margin-inline-start: 50px; }

The 'inset-inline-start' CSS property defines the distance between the inline start edge of an element and its containing block. This property is particularly useful for creating responsive layouts that adapt to different text directions, such as left-to-right or right-to-left. By adjusting the 'inset-inline-start', you can control the positioning of elements in a way that respects the writing mode of the document.

inset-inline-end
.container {
  display: flex;
  justify-content: flex-end;
  height: 100vh;
  background-color: #f0f0f0;
  padding-inline-end: 20px;
}

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

The 'inset-inline-end' CSS property defines the logical end offset of an element's box, allowing for precise positioning in a way that respects the writing direction of the content. It is particularly useful in responsive design and for adapting layouts to different languages and writing systems. This property can be used to create spacing or positioning effects that adjust automatically based on the text direction.

inset-inline
.container { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; }
.box { width: 200px; height: 100px; background-color: #4CAF50; color: white; display: flex; justify-content: center; align-items: center; position: relative; inset-inline: 20px; }

The 'inset-inline' CSS property is a shorthand for setting the 'inset-inline-start' and 'inset-inline-end' properties, which control the inline (left/right) positioning of an element. It allows for more straightforward control of an element's position within its container in a responsive manner, especially useful in layouts that adapt to different writing modes and text directions.