Unit  2   Cascading Style Sheet(CSS)

Features

  1. Separates the presentation and contents of the HTML document
  2. Provide numerous attributes to create dynamic effects
  3. Simple
  4. Reusable

Style  sheet

  1. A set of statements that specify presentation of a document
  2. A powerful mechanism for adding styles
  3. Styles can be assigned by the<STYLE></STYLE>tag
  4. Each rule is made up of a selector—usually an HTML element such as BODY,p,or h1

Advantages

Selectors

  1. Element selector
  2. Inheritance
  3. Class selectors
  4. ID selectors
  5. Contextual Selectors
  6. Grouping
  7. Pseudo-classes

Ways of specifying styles

  1. Inline
  2. Embedded(Internal style sheets)
  3. External style sheets(Linking)
  4. Importing

Ways to cascade style sheets

  1. By importing the Style sheet
  2. Multiple websites can use the same style sheet

Related Tags

  1. span
  2. div

Style properties