Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

first-child

Description

The first-child pseudo-class for CSS represents an element that is the first child of its parent.

It is the same as :nth-child(1).

Syntax

selector:first-child
{
    property: value;
}

Examples

1 · CSS

2 · JS

first-of-type

last-child

last-of-type

nth-child

nth-last-child

nth-last-of-type

nth-of-type

only-child

only-of-type

active

any-link

autofill

blank

checked

default

defined

dir

disabled

empty

enabled

first-of-type

focus

focus-visible

focus-within

fullscreen

has

hover

in-range

indeterminate

invalid

is

lang

last-child

last-of-type

link

local-link

modal

not

nth-child

nth-col

nth-last-child

nth-last-col

nth-last-of-type

nth-of-type

only-child

only-of-type

optional

out-of-range

picture-in-picture

placeholder-shown

popover-open

read-only

read-write

required

root

scope

target

valid

visited

where

World Wide Web Consortium (W3C)

HomeMenu