Trusted answers to developer questions

What is the first of type selector in CSS?

Get Started With Data Science

Learn the fundamentals of Data Science with this free course. Future-proof your career by adding Data Science skills to your toolkit — or prepare to land a job in AI, Machine Learning, or Data Analysis.

​The :first-of-type selector is used to target the first child occurrence of every element of its parent. The first child of that particular element will adopt all of the properties.


Syntax

The syntax for the :first-of-type selector given below:

svg viewer

Examples

The code examples below show how the :first-of-type selector is used to manipulate the formatting properties that follow:

RELATED TAGS

css
first of type selector
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?