1 / 10

Cascading Style Sheets

Cascading Style Sheets. What is a style sheet?. A controlling document (or part of the document) Sets the default appearance of items on the web page. Advantages. Greater control over document look and feel Less key stroking. Disadvantages. Not downwardly compatible

Télécharger la présentation

Cascading Style Sheets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cascading Style Sheets

  2. What is a style sheet? • A controlling document (or part of the document) • Sets the default appearance of items on the web page.

  3. Advantages • Greater control over document look and feel • Less key stroking

  4. Disadvantages • Not downwardly compatible • Not implemented across browsers and platforms evenly.

  5. Three ways to attach a style tag • Inline • <h1 style=“color: blue; font-style: italic”> I am so blue</h1> • Document-level • External style sheets

  6. Style Syntax • Tag-selector {property1:value1; property2:value1, vaue2, value3;…}

  7. Multiple Selectors • H1, H2, H3 {text-align: center} is the same as • H1 {text-align: center}H2 {text-align: center}H3 {text-align: center}

  8. Contextual Selector • OL LI {list-style: upper-alpha}OL OL LI {list-style: upper-roman}OL OL OL LI {list-style: lower-alpha}OL OL OL OL LI {list-style: lower-roman} • Note: no commas used

  9. Classes • Classes are subsets of a style • P.big {font-size: 18pt}P.medium {font-size: 12pt}P.small {font-size: 9pt} • Classes can be defined with out being associated with a tag.

  10. Special Cases • A:link, A:active, A:visited – define the 3 states of the <a> tag. • P:first-lineP:first-letter define 2 states of <p>

More Related