Quantcast
Channel: css – Yostivanich
Viewing all articles
Browse latest Browse all 26

Quantity Queries for CSS

$
0
0

In this article, I will be outlining a technique to make CSS quantity-aware using specially formed selectors. I will be applying these selectors to one classic problem in particular: how to alter the display of items in a horizontal navigation menu when there are too many to suit the initial layout mode. That is, I will demonstrate how to switch from a display: table-cell to a display: inline-block layout when the number of items in the menu becomes “more than or equal to 6.”

This is one cool technique, though it requires a fair bit of forethought at the implementation stage.

∞ Permalink


Viewing all articles
Browse latest Browse all 26

Trending Articles