CSS is used to style and lay out HTML elements. CSS rules contain selectors that identify elements and declarations that specify properties and values to style those elements. Different selector types like type, ID, class, and multiple selectors allow rules to target different element groups. Embedded style sheets contain CSS code directly in HTML, while external style sheets can style multiple pages by linking via the <link> element. Comments document style sheets, and developer tools and validators help debug and standardize CSS code.