CSS terminology: what are these called?

前端 未结 7 1533
面向向阳花
面向向阳花 2021-02-13 22:42

Consider:

p {
  ...
}

.foo {
  ...
}

#bar {
  ...
}

What is the correct name for these statements in CSS? I\'ve seen them called selectors, rules or rule

相关标签:
7条回答
  • 2021-02-13 23:11

    CSS is made up of a number of rules in the form

    selector{declaration}
    

    So the .foo and #bar and p are called selectors but the full statement with the curlies are called rules.

    0 讨论(0)
提交回复
热议问题