CSS Documentation

CSS Miscellaneous

CSS Miscellaneous

This section covers various CSS properties and techniques that don't fit neatly into other categories but are still important for web development.

CSS Variables (Custom Properties)

CSS Variables allow you to store specific values to be reused throughout a document.

:root {
--main-color: #007bff;
}

.button {
background-color: var(--main-color);
}

CSS Counters

CSS Counters let you adjust the appearance of content based on its location in a document.

body {
counter-reset: section;
}

h2::before {
counter-increment: section;
content: "Section " counter(section) ": ";
}

CSS Shapes

CSS Shapes allow you to create non-rectangular shapes for text to flow around.

.circle {
width: 200px;
height: 200px;
shape-outside: circle(50%);
float: left;
}

CSS Filters

CSS Filters provide graphical effects like blurring or color shifting on an element.

.blur {
filter: blur(5px);
}

.grayscale {
filter: grayscale(100%);
}

CSS Scroll Snap

CSS Scroll Snap allows you to create smooth scrolling experiences by defining "snap points".

.container {
scroll-snap-type: y mandatory;
}

.child {
scroll-snap-align: start;
}

CSS Writing Modes

CSS Writing Modes allow you to support different international writing modes.

.vertical-text {
writing-mode: vertical-rl;
}

These miscellaneous CSS features can greatly enhance your web designs and provide solutions for specific layout and styling challenges.