2 months 3 weeks ago

Block, Element, Modifier (BEM) Naming Convention for CSS

The Block, Element, Modifier (BEM) methodology is a popular naming convention for classes in HTML and CSS. The main goal of this methodology is to help developers better understand the relationship between the HTML and CSS in a given project. Better style guide can significantly increase development speed, debugging, and the implementation of new features in development but most of the time CSS codebases are sometimes developed without any structure or naming conventions.
2 years 4 months ago

The powerful features of css pseudo class selectors :nth-child and :nth-last-child

CSS3 provides powerful pseudo-classes that allow the CSS designer to select multiple elements according to their positions in a document tree. The :nth-child(an+b) CSS pseudo-class  matches a number of child elements whose numeric position in the series of children matches the pattern an+b. The argument, n, can be a keyword, a number, or a number expression of the form an+b. Think of "n" as starting at zero and then a set of all positive integers. Then complete the expression. So the 2n is "2xn", and the whole expression together is "(2xn)+3".