Several tricks that I used very often:
While you complaining there's no :not(:first-of-class) selector, you can do this instead:
:not(:first-of-class)
.foo + .foo { margin-top: 1rem; }
grid-gap
.album { --gap: 1rem; padding-top: var(--gap); padding-left: var(--gap); } .album > .photo { margin-right: var(--gap); margin-bottom: var(--gap); }
a { display: block; text-decoration: none; /* blah blah blah... */ } a.logo { /* This disables all the rules defined above */ all: unset; /* start from fresh */ }
I never knew about all! Thank you for this!
all
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Several tricks that I used very often:
Select all the elements with same class except for the first one
While you complaining there's no
:not(:first-of-class)
selector, you can do this instead:Mimicking
grid-gap
without using grid layout:Clear all the predefined styles
I never knew about
all
! Thank you for this!