Course Content
Introduction to CSS Part I
Introduction to CSS Part I
Basic Syntax of CSS
Comments
In CSS, comments are denoted using the /*
and */
symbols. Anything between these symbols is considered a comment.
Comments can be placed anywhere in your CSS code, including within selectors, property declarations, and at the end of lines.
Any CSS rules start with a selector, which selects the elements to apply the rules. The rules are given in the syntax of property: value
, where the property is the stylistic aspect of the element you want to change, which in this case is color
with the value black
.
Selectors
Selectors specify which elements the styles should be applied to on a web page. :
Properties and values
Properties define the characteristics of an element, such as its color
, font
, or size
. Values are assigned to properties to specify the specific characteristics.
The cascade
The "cascading" in Cascading Style Sheets refers to how styles are inherited from one element to another. When multiple styles are applied to the same element, the most specific style will take precedence. For example:
Specificity
Specificity refers to the weight given to a particular style when it conflicts with another style. The more specific a style is, the more weight it has and the more likely it is to be applied.
Thanks for your feedback!