--%>

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 : What is no-arg constructor no-arg

    no-arg constructor: It is a constructor which takes no arguments. By default, each and every class without an explicit constructor has a default no-arg constructor with the public access. Its role is entirely to invoke the no-arg constructor of the in

  • Q : Explain Upcast Upcast: It is a cast

    Upcast: It is a cast towards an object's ultimate super type - which is, `up' the inheritance hierarchy towards the Object class, for example:         // Upcast from VariableContr

  • Q : Explain UpdatePanel control Briefly

    Briefly explain about the UpdatePanel control.

  • Q : Explain the purpose of using XML

    Explain the purpose of using XML.

  • Q : Program is prone to deadlock when

      Give a brief introduction about the operation of your program and show that you understand the idea behind threads and mutual exclusion variable. Why do we need to use mutual exclusion to control the access of the three global variables? What is the potential p

  • Q : What is an Attribute Attribute : It is

    Attribute: It is a particular usage of an instance variable. The set of attribute values held in a specific instance of a class state the current state of that instance. A class definition might impose specific constraints on the valid states of its i

  • Q : Define the term Icon Icon : It is an

    Icon: It is an image intended to communicate the language-or culturally-independent meaning.

  • Q : Explain the common uses of XML Explain

    Explain the common uses of XML.

  • Q : Explain the java applets with a

      APPLET: an applet is an application designed to tra

  • Q : Reads a line of text and tests whether

    palindrome.asm -- reads a line of text and tests whether it is a palindrome. ## Register usage: ## $t1 - A. ## $t2 - B. ## $t3 - the character *A. ## $t4 - the character *B. ## $v0 - syscall parameter / return values. ## $a0 - s