CSS defines a finite set of parameters, called properties, that defines the rendering of a document.
Properties are written in a css rule after the element selection definition.
Properties are attached to various parts of the document and to the page on which the document is to be displayed by the mechanisms of:
CSS 2.1 has more than 90 properties 1)
p {
color : blue ; /* first property */
font-weight : bold /* second property */
}
<p>A bold blue paragraph</p>
Each property has:
property-name: value
Each CSS property definition begins with a summary of key information that resembles the following:
Some properties are shorthand properties, meaning that they allow authors to specify the values of several properties with a single property. When values are omitted from a shorthand form, each “missing” property is assigned its initial value.
For instance, the 'font' property is a shorthand property for setting:
The multiple style rules of this example:
h1 {
font-weight: bold;
font-size: 12pt;
line-height: 14pt;
font-family: Helvetica;
font-variant: normal;
font-style: normal;
}
may be rewritten with a single shorthand property:
h1 { font: bold 12pt/14pt Helvetica }
In this example, 'font-variant', and 'font-style' take their initial values.
To suppress a property, you have to set its value to initial or unset.
If you want to get via Javascript the computed value, see this article: How to get the CSS computed style values of an HTML element
<h1>Article Title</h1>
let title = document.querySelector('h1');
let display = window.getComputedStyle(title).getPropertyValue('display');
console.log('The display of the heading h1 is :'+display);
In Javascript, the property style of an element are available via the style property. The name of the property is camelCased.
Example: select the first paragraph and make it steelblue
var element = document.querySelector('p');
element.style.color = "steelblue";
<p>A steelblue paragraph</p>