Articles by

Mojtaba Seyedi

Direct link to the article sibling-count()

sibling-count()

The sibling-count() CSS function returns the total number of sibling elements an element has, including itself. Think of it sort of as the CSS equivalent of JavaScript’s element.parentElement.children.length.…

Updated on
Direct link to the article sibling-index()

sibling-index()

The sibling-index() CSS function returns the position of an element among its siblings, starting from 1. It's similar to :nth-child(), but instead of using it in selectors, you can now use the index directly within CSS functions and calculations.
Updated on
Direct link to the article :has()

:has()

The CSS :has() pseudo-class selects elements that contain other elements that match the selector passed into its arguments. It’s often referred to as “the parent selector” because of its ability to select a parent element based on the child elements …

Updated on
Direct link to the article grid-row

grid-row

The grid-row CSS property is a shorthand that specifies the row grid lines where a grid item starts and ends in a grid layout, and does it in a single declaration.

.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.grid-item:nth-child(2) 
Direct link to the article grid-column

grid-column

The grid-column CSS property is a shorthand that specifies the column grid lines where a grid item starts and ends in a grid layout in one declaration.

.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.grid-item:nth-child(2) {
  grid-column: 3 / 
Updated on