What is the usage of Class selector?

devquora
devquora

Posted On: Feb 22, 2018

 

A name preceded by a full stop is considered as a class selector in CSS. Selectors that are unique to a specific style, are called CLASS selectors. Declaration of style and association with HTML can be made through this. An ID identifies a single element whereas a class identifies more than one element.

Syntax for the class selector:

Classname:it can be A-Z, a-z or digits.


.top {font: 14em ;} //class selector
<Body class= "top"> //this class is associated with element </body>

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    CSS Interview Questions

    What is CSS?

    Cascading style sheets or CSS is a web designing language simple for HTML elements. The application is commonly known a..

    CSS Interview Questions

    What are the advantages of CSS?

    There are a number of advantages of CSS, It gives lots of flexibility for setting the properties of the element Easy ma..

    CSS Interview Questions

    In how many ways can a CSS be integrated as a web page?

    CSS can be integrated in three ways: Inline: term is used when the CSS code have attribute of HTML elements&lt;p styl..