Generate Your Own Playground
Type any CSS property and get a live, editable playground instantly.
.container {
width: 200px;
border: 1px solid #ccc;
padding: 10px;
overflow-wrap: break-word;
}
.hyphenated {
hyphens: auto;
font-size: 16px;
line-height: 1.5;
width: 100%;
overflow-wrap: break-word;
}The 'hyphens' property in CSS controls the automatic hyphenation of words in a text block when they overflow their container. This property can enhance readability in narrow columns of text by breaking long words at appropriate points, adding hyphens where necessary. It is particularly useful for languages that have hyphenation rules.
.container { background-color: #f0f0f0; padding: 20px; text-align: center; } .box { height: 150px; width: 150px; background-color: #3498db; color: white; display: flex; align-items: center; justify-content: center; border-radius: 10px; }The 'height' property in CSS specifies the height of an element. It can be set using various units such as pixels, percentages, or viewport units. Adjusting the height can significantly affect the layout and appearance of web elements.
.text-container { width: 300px; margin: 20px; font-family: Arial, sans-serif; font-size: 18px; }
.hanging-punctuation { hanging-punctuation: first; text-align: justify; margin-left: -0.5em; display: inline-block; }The 'hanging-punctuation' CSS property controls the placement of punctuation marks at the beginning or end of a line of text. It allows punctuation marks to hang outside the margin, creating a more visually appealing text layout. This property is particularly useful in typography for improving readability and aesthetics in text-heavy designs.
.grid-container { display: grid; grid-template-rows: 100px 200px auto; gap: 10px; }
.grid-item { background-color: lightblue; border: 1px solid blue; display: flex; align-items: center; justify-content: center; font-size: 20px; }The 'grid-template-rows' CSS property defines the height of the rows in a grid layout. It allows you to specify the size of each row, enabling you to create complex layouts with ease. This property is particularly useful for creating responsive designs and controlling the visual hierarchy of content.
.grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-item { background-color: #4CAF50; color: white; padding: 20px; text-align: center; border: 1px solid #ddd; }The 'grid-template-columns' property in CSS defines the number and size of the columns in a grid layout. It allows you to create complex and responsive layouts by specifying the width of each column, either in fixed units or relative units. This property is essential for organizing content into a structured grid format.