Presentation is loading. Please wait.

Presentation is loading. Please wait.

CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External.

Similar presentations


Presentation on theme: "CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External."— Presentation transcript:

1 CASCADING STYLE SHEETS

2 Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External style sheets

3 The Power of Styles Review Chapter 1 –URL in browser instructs PC to request a doc –Server returns the HTML source document for URL Review Chapter 2 –Structure and content on the page; also presentation,, –Browser displayed elements in default styles In this Chapter, customize styles

4 Creating an Internal Style Sheet Redefine the presentation rules for an element on a single page Defined in the head element Defining the style sheet language for a element as css (cascading style sheets): h2 {color:red}

5 Changing the Alignment h1 {text-align:center; font-style:italic; font-size:30pt} h2 {color:red; font-size:24pt; font-variant:small-caps}

6 Formatting Fonts Using Styles Absolute sizes in points (24pt) Percentage (150%) Preset values of xx-small, x-small, small, medium, large, x-large, and xx-large. h1 {text-align:center; font-size:30pt}

7 Bold and Italic Revisited font-style:italic (or normal, oblique) h1 {text-align:center; font-style:italic; font-size:30pt} font-weight:bold (or normal, bolder, lighter, or the values 100, 200,... 900) h2 {text-align:center; font-weight:bolder}

8 Beyond Bold and Italic text-decoration text-decoration:underline (or overline, line-through, none, blink) text-transform text-transform:capitalize (or uppercase, lowercase, none) font-variant font-variant:small-caps (or none) background background:color:red (or transparent or predefined color name or valid color number)

9 Paragraph Styles p {font-size:14pt} text-indent:25pt (or a percentage of the line width, e.g., 10%; negative for hanging indent) line-height:20pt (or a percentage of the single-line height, e.g., 150%, or a multiplication factor, e.g., 1.5)

10 Font Families font-family:"Lucida","Arial" (first-choice and second- choice font names) font: italic bolder small-caps 14pt/24pt "Lucida","Arial"

11 One Tag, Multiple Styles: Classes Class Example p {text-align:justify; font-weight:bold} p.intro {text-align:center; color:red} This paragraph will be centered with red, bold text. This paragraph will be bold text with justified alignment.

12 Using Local Styles This paragraph will be uppercase and red (in addition to any other style properties that may be defined for the regular paragraph).

13 Creating Custom Tags span {font-size:18pt} Let me make one thing perfectly clear…

14 External Style Sheets

15 End of Chapter 3 Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External style sheets


Download ppt "CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External."

Similar presentations


Ads by Google