--%>

What is Class Selector in the CSS

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

E

Expert

Verified

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 : Benefits of the event-delegation model

    Write down some of the benefits of the event-delegation model over event-inheritance model?

  • Q : Define Livelock Livelock : It is a

    Livelock: It is a situation in which a thread waits to be notified of a condition however, on waking, finds that the other thread has inverted the condition another time. The primary thread is forced to wait again. Whenever this occurs for an indefini

  • Q : Define Preempt Preempt: It is the

    Preempt: It is the presently executing thread might be preempted, or forced to give up control, by a higher priority thread which becomes eligible to run throughout its time slice.

  • Q : Define the term Boot Boot: Whenever a

    Boot: Whenever a computer is switched on it is said to be `boot up'. This word comes from the phrase, “Pulling yourself up by your bootstraps”. Before a computer is ready to be utilized, it should load the programs which it requires from i

  • Q : What is an Implicit type conversion

    Implicit type conversion: The type conversion which does not need a cast. Implicit type conversions usually do not comprise any loss of information. For example, joining an integer operand with a floating point operand in an arithmetic expression will

  • Q : Difference between the choice and list

    Illustrate the difference between the choice and list?

  • Q : Use Polymorphism Use Polymorphism :

    Use Polymorphism: Programs, especially those converted from non-OOP languages like C, sometimes use state where they should use inheritance. For example,

    Q : Define process group Define the process

    Define the process group?

  • Q : Explain way to communicate server with

    Explain the way to communicate server with more than one client.

  • Q : What is Break statement Break statement

    Break statement: A statement employed to break out of a loop, switch statement or labeled block. In all situations, control continues with the statement instantly, subsequent to the containing block.