Terms used in the CSS

Asked

Viewed 75 times

3

Knowing that CSS literally means Cascade Style Sheets, regularly see the term "property" being used to refer to left, width, top, background etc..

The following question arose before me:

Is this reference correct? If so, then what are the "styles" referred to by the name "Style" in the CSS acronym?

1 answer

4


Property is only one of the components of a style.

CSS can be understood (in a very simplified way) as a simple list of properties/values pairs applied to an HTML element.

This is clearer if you think of the style in line. Example:

<h1 style="color:blue;text-align:center">Isto é um cabeçalho azul</h1>

Note that the attribute sytle applies a property/value pair list to the tag h1.

left, width, top, background are properties.

You can only consider a style when these properties are applied to an element:

div {
   left:10px;
   width:100px;
   top:5px;
   background-color: lightblue;
}
  • If you see the meaning of the word style, you will see that one of the meanings is : "set of formal features that identify an object.". So yes, a group of properties/values bounded by {} can be considered a style

Browser other questions tagged

You are not signed in. Login or sign up in order to post.