Beginning HTML, XHTML, CSS and JavaScript - Code Examples

Back to main book index

Chapter 7: Cascading Style Sheets

Here are the examples for Chapter 7, which introduces CSS.

ch07_eg01.htmlA first example of CSS

Font Properties

ch07_eg02.htmlThe font-family Property
ch07_eg03.htmlThe font-size Property
ch07_eg04.htmlThe font-weight Property
ch07_eg05.htmlThe font-style Property
ch07_eg06.htmlThe font-variant Property

Text Properties

ch07_eg07.htmlThe color Property
ch07_eg08.htmlThe text-align Property
ch07_eg09.htmlThe vertical-align Property
ch07_eg10.htmlThe text-decoration Property
ch07_eg11.htmlThe text-indent Property
ch07_eg12.htmlThe text-shadow Property Not yet supported
ch07_eg13.htmlThe text-transform Property
ch07_eg14.htmlThe letter-spacing Property
ch07_eg15.htmlThe word-spacing Property
ch07_eg16.htmlThe white-space Property
ch07_eg17.htmlThe direction Property
ch07_eg18.htmlThe first-letter and first-line Psuedo-Classes
Try it OutStyling the Example Cafe text

Selectors

ch07_eg19.htmlAdjacent and sibling selectors
ch07_eg20.htmlAttribute selectors

The Box Model

ch07_eg21.htmlAn example of the Box Model
ch07_eg22.htmlThe border-style Property
ch07_eg23.htmlThe padding Property
ch07_eg24.htmlThe margin Property
ch07_eg25.htmlThe height and width Properties
ch07_eg26.htmlThe line-height Property
ch07_eg27.htmlThe max-width and min-width Properties
ch07_eg28.htmlThe max-height and min-height Properties
ch07_eg29.htmlThe overflow Property
Try it OutStyle sheet for code

Exercises

Exercise 1Updated Example Cafe
Exercise 2Table Styles