What are the two parts of CSS declaration?

Questions by JohnMathew   answers by JohnMathew

Showing Answers 1 - 6 of 6 Answers

osman

  • May 15th, 2007
 

Property and value

  Was this answer useful?  Yes

chakii

  • Aug 24th, 2008
 

A CSS declaration has two parts,

a property ("color") and a value ("red"). 

The basic syntax of a rule

selector {property 1:value 1; property 2:value 2} " 

An example (containing two declarations, as above)

P {font-size:8pt; color:red}

CSS is not picky about whitespace, linebreaks, or extra semi-colons, so you can format complex CSS files to make them more manageable;

P {
font-size: 8pt;
color: red;
}

In addition, you can apply the same style rules to more than one element simultaneously by comma-separating them;

H1, H2, H3 {
font-size: 8pt;
color: red;
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions