DEV Community

shubham mishra
shubham mishra

Posted on • Originally published at developerindian.com

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

Top comments (0)