Lesson 10: Basic Properties in CSS
CSS Properties
The following table lists CSS properties that can be applied to HTML content inline:
| Property: | Value: | Use with Elements: |
|---|---|---|
| color | #RRGGBB (Red, Green, Blue hex values) | any element that contains text |
| text-align | left | right | center | justify | block elements h1..h6, p, li, etc. |
| text-decoration | none | underline | overline | line-through | blink| inherit | mostly with a (anchor) elements |
| text-transformation | none | capitalize | uppercase | lowercase | any element that contains text |
| line-height | % or px | block elements h1..h6, p, li, etc. |
| letter-spacing | normal or px value | any element that contains text |
| font-family | font or font-family [, font or font-family ...] | any element that contains text |
| font-size | px or em value | any element that contains text |
| font-style | normal | italic | oblique | any element that contains text |
| font-weight | normal | bold | any element that contains text |
| background-color | #RRGGBB (Red, Green, Blue hex values) | any element that contains background |
| background-image | url("[image url]") | mostly with body |
| background-repeat | repeat | repeat-x | repeat-y | no-repeat | mostly with body |
| background-position | left | center | right | top | center | bottom | mostly with body |
| list-style-type | disc | square | circle | unordered list |
| list-style-type | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | ordered list |
CSS Playground
Use the following trinket to play with the above properties.