DEV Community

shubham mishra
shubham mishra

Posted on • Originally published at developerindian.com

1

What is different type of Selector in CSS -dev.to

What is different type of Selector in CSS

Basically Cascading style sheet css used to design a font and color etc on html element therefore we need to specify target html element .

So if you want to select or target HTML element ,following are selector :

  • Universal selector
  • Type selector
  • class selector
  • ID selector

** Introduction of Css and History of Css**
Cascading Style Sheets (CSS) is a simple mechanism for adding style
(e.g., fonts, colors, spacing) to Web documents

Althrogh HTML isvery essentialto generate adding
a web page bu their aresome important drawback which HTML
suffer

HTML has no style for layout
Using HTML we can’t add position of element
HTML does’t support for multiple unit like px ,em etc

Background image display using HTML repeate itself

To improve look and feel WC3 school launch a new language
called css in year 1996 .

The term css stand for Cascading Style Sheets
It is purly a design language
It only to handle look and feel of our page .

This means that still we have to use HTML
to process element but there presentation manage
by CSS

CSS Syntex :

Selector { property : Value }

“:+” single value

As I mention CSS are provide below type selector which are :

Universal selector : This selector are apply to all element of Html.
Type selector : This selector are apply to particular HTML tag.
Class selector :This selector are apply on same value of class attriute.
ID selector : This selector are apply on attribute of ID of Html element

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay