What is Class Selector in the CSS

Explain what is meant by the Class Selector in the CSS?




Class selector chooses all the HTML tags that matches the class name described within the tag attribute of class="class_name". Class selectors are specified with leading dot such as (.class_name). For example, following

CSS definition utilizes the class selector:

/* set text to italic to all tags with class="quote" */
.quote {font-style: italic}

In case, you apply above CSS definition to the following given HTML document, you will obtain two blocks in the italic, one from the <p> tag and one from the <pre> tag:

<p>Normal paragraph...</p>
<p class="quote">Special paragraph...</p>
<pre>Normal pre-formatted text...
<pre class="quote">Special pre-formatted text...</pre>

   Related Questions in Programming Languages

  • Q : State the term LDAP State the term LDAP

    State the term LDAP?

  • Q : State the term non-XML resources State

    State the term non-XML resources?

  • Q : What is Modal What is Modal : A dialog

    What is Modal: A dialog is a modal when its parent application is blocked from additional activity until the dialog has finished.

  • Q : Explain Imperative programming

    Imperative programming: The style of programming generally related with languages such as FORTRAN, C, Pascal and so forth. Imperative programming is differentiated from functional programming in that the previous is strongly tied to the idea of variab

  • Q : What is Left shift operator Left shift

    Left shift operator: Left shift operator (<<) is the bit manipulation operator. This moves the bits in its left operand zero or additional positions to the left, according to the value of its right operand. The zero bits are added up to the righ

  • Q : Ways in which Java program is less

    Give two ways in which a Java program is less likely to be compromised than the same program written in C++.

  • Q : Explain the relationship between XHTML

    Explain the relationship between XHTML and the Web?

  • Q : Explain If-else statement If-else

    If-else statement: It is a control structure employed to select between performing one of two alternative events.

            // Statem

  • Q : What is an Import statement Import

    Import statement: A statement which makes the names of one or more interfaces or classes accessible in a different package from the one in which they are stated. Import statements pursue any package declaration {package!declaration}, and precede any i

  • Q : Define Constant Constant : It is the

    Constant: It is the memory block where value can be stored once although can’t modify later on throughout program execution. Example: const int pi =3.14;