Category CSS

CSS :target Selector

CSS :target selector example.

The :target selector is a pseudo-class in CSS selecting the element that is the target element of the referring URI. In other words, this pseudo-class selects the element being targeted by a fragment identifier in the URL. A fragment identifier…

CSS :empty Selector

The selector :empty is a pseudo-class in CSS selecting elements that have no children. In simple words, this selector targets the elements that define no children. The general syntax to define :empty selector in CSS is as follows: element:empty {…

CSS :only-of-type Selector

CSS :only-of-type selector with example.

The selector :only-of-type in CSS is a pseudo-class selecting an element that is the only sibling of its type. In other words, this pseudo-class allows you to select an element that in the only one of its type within its…

CSS :only-child Selector

CSS :only-child selector example.

The :only-child selector in CSS is a powerful pseudo-class that allow you to select an element that is the only siblings of its type. In other words, this pseudo-class matches an element that is the only child of its parent.…

CSS :first-of-type And :last-of-type Selectors

CSS :first-of-type selector example

In this tutorial, we will understand :first-of-type and :last-of-type selectors in CSS with the help of some important examples. Let’s first understand :first-of-type selector. In CSS, the :first-of-type selector is a pseudo-class that selects the first sibling of its type.…