not:first-child selector

One of the versions you posted actually works for all modern browsers (where CSS selectors level 3 are supported): div ul:not(:first-child) { background-color: #900; } If you need to support legacy browsers, or if you are hindered by the :not selector’s limitation (it only accepts a simple selector as an argument) then you can use … Read more

What does the “~” (tilde/squiggle/twiddle) CSS selector mean?

The ~ selector is in fact the subsequent-sibling combinator (previously called general sibling combinator until 2017): The subsequent-sibling combinator is made of the “tilde” (U+007E, ~) character that separates two sequences of simple selectors. The elements represented by the two sequences share the same parent in the document tree and the element represented by the … Read more

How can I make Bootstrap columns all the same height?

LATEST SOLUTION (2022) Solution 4 using Bootstrap 4 or 5 Bootstrap 4 and 5 use Flexbox by default, so there is no need for extra CSS. Demo <div class=”container”> <div class=”row “> <div class=”col-md-4″ style=”background-color: red”> some content </div> <div class=”col-md-4″ style=”background-color: yellow”> catz <img width=”100″ height=”100″ src=”https://placekitten.com/100/100/”> </div> <div class=”col-md-4″ style=”background-color: green”> some more … Read more

What is the best way to conditionally apply a class?

If you don’t want to put CSS class names into Controller like I do, here is an old trick that I use since pre-v1 days. We can write an expression that evaluates directly to a class name selected, no custom directives are necessary: ng:class=”{true:’selected’, false:”}[$index==selectedIndex]” Please note the old syntax with colon. There is also … Read more

CSS selector for first element with class

This is one of the most well-known examples of authors misunderstanding how :first-child works. Introduced in CSS2, the :first-child pseudo-class represents the very first child of its parent. That’s it. There’s a very common misconception that it picks up whichever child element is the first to match the conditions specified by the rest of the … Read more

Better way to set distance between flexbox items

Flexbox doesn’t have collapsing margins. Flexbox doesn’t have anything akin to border-spacing for tables (edit: CSS property gap fulfills this role in newer browsers, Can I use) Therefore achieving what you are asking for is a bit more difficult. In my experience, the “cleanest” way that doesn’t use :first-child/:last-child and works without any modification on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)