Results for “css”
Small, practical examples. Search by task or narrow things down below.
Set several inline styles together
jQuery: Pass a property-value object to css.
jQuery✓ Tested
Set space between text lines
CSS: Learn how to set space between text lines in a complete browser example.
CSS✓ Tested
Show a pressed pointer state
CSS: Active applies during the pointer press rather than after the click has finished.
CSS✓ Tested
Show keyboard focus
Use a visible CSS outline when an input receives keyboard focus.
CSS✓ Tested
Size a child relative to its containing block
CSS: A percentage width is based on the containing block’s available width.
CSS✓ Tested
Size a panel relative to viewport height
CSS: Viewport height units track the browser viewport rather than the parent element.
CSS✓ Tested
Space items with gap
Use CSS gap instead of margins between flex children.
CSS✓ Tested
Span a grid item across multiple columns
CSS: Grid-column span counts tracks and includes the gaps between them.
CSS✓ Tested
Specify a flex item’s initial main size
CSS: Flex-basis establishes the starting main-axis size before growth or shrinkage.
CSS✓ Tested
Stack columns on small screens
Change a two-column CSS grid to one column at a viewport breakpoint.
CSS✓ Tested
Stack flex items vertically
CSS: Flex-direction column makes the main axis vertical.
CSS✓ Tested
Style a card based on a selected descendant
CSS: Has matches the parent when its relative selector finds a checked control inside it.
CSS✓ Tested