CSS Syntax
Next ❯CSS Selectors
- turned_in_notSyntax
selector { property1: value1; property2: value2; .................; .................; propertyN: valueN; }
Example:
- turned_in_notSyntax Sample
- trending_downSyntax Description
- Selector : Element/Tag you want to style
- Declaration Block : Contains one or more declarations separated by semicolons (;) inside curly brackets
- Property : Specific property to the HTML elements
- Value : Value to the specific property
CSS Comments
Mainly helpful to the programmer or can say developer for modifications if required later, used to explain the code
- Syntax:
/* Your comment */
- Ignored by browsers
Example:
- turned_in_notSingle Line Comment
p { color: red; /* This is a single-line comment */ text-align: center; }
- label_outlineMulti Line Comment
p { /* This is a multi-line comment */ font-size: 10px; }
❮ Prev Introduction
Next ❯CSS Selectors