Top 10 CSS properties you must know

May 02, 2021css-practicescss

CSS is easy to pick up but hard to master because of its countless confusing properties. Especially those shorthands can accept multiple values of multiple data types in any order.

This is a curated list of top 10 important CSS properties you must know ranked by their usage frequency and complexity.

  1. background - the shorthand property sets all background style properties at once, such as color, image, origin and size, or repeat method.
  2. border - the shorthand property sets an element’s border. It sets the values of border-width, border-style, and border-color.
  3. display - sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex.
  4. position - sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.
  5. z-index - sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one.
  6. float - places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).
  7. clear - sets whether an element must be moved below (cleared) floating elements that precede it. The clear property applies to floating and non-floating elements.
  8. box-shadow - adds shadow effects around an element’s frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.
  9. transition - a shorthand property to define the transition between two states of an element. Different states may be defined using pseudo-classes like :hover or :active or dynamically set using JavaScript.
  10. transform - lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.