Can I attach more than one declaration to a selector?


Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list, e.g.;

Selector {declaration1; declaration2}
P {background: white; color: black}



Explore posts in the same categories: CSS Interview Questions


BOOKMARK THIS : del.icio.us | Digg it | Furl | reddit |


Related Questions :

  • What is CSS rule ‘ruleset’?
  • There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is...
  • What is CSS declaration?
  • CSS declaration is style attached to a specific selector. It consists of two parts; property which is equivalent of HTML...
  • How does a message consumer filters messages?
  • Consumers can filter messages using message selector. Developer has to specify a message selector (String) as an argument when we...
  • What is ID selector?
  • ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID attribute the...
  • What is a Declaration?
  • A declaration declares one or more variables or methods for use later in the JSP source file. A declaration must contain...
  • What is a Declaration ?
  • A declaration declares one or more variables or methods for use later in the JSP source file. A declaration must contain...
  • What is cascade?
  • Cascade is a method of defining the weight (importance) of individual styling rules thus allowing conflicting rules to be sorted...
  • What is declaration
  • The very first thing in an XML document, which declares it as XML. The minimal declaration is The declaration is...
  • What is the use of ‘using’ declaration?
  • A using declaration makes it possible to use a name from a namespace without the scope operator....
  • What is ‘important’ declaration?
  • Important declaration is a declaration with increased weight. Declaration with increased weight will override declarations with normal weight. If both...

    Comment:

    You must be logged in to post a comment.