Download presentation
Presentation is loading. Please wait.
Published byLouisa Richardson Modified over 8 years ago
1
CSS Cascading Style Sheets
2
Session Checklist ► Learn why style sheets are needed and their advantages and disadvantages ► Learn the format of a style in a style sheet and the most popular styles ► Prepare a style sheet for an individual Web page or one for an entire site
3
Introduction ► Separate content from style ► HTML was created as a semantic language ► Characteristic felt as a limitation ► Back to the roots
4
Definition of Style Sheets ► Style Sheet Group of Rules
5
Advantages of Style Sheets ► You can speed the formatting of your Web pages ► You can change the look of your entire Web site by changing only the style sheet’s styles ► Style sheets support formatting that straight HTML does not support ► Maintain the separation between content and style
6
CSS Syntax ► The CSS syntax is made up of three parts: Selector Property Value selector {property: value}
7
CSS examples body {color: black} p {font-family: "sans serif"} p {text-align: center; color: red} p { text-align: center; color: black; font-family: arial } p { text-align: center; color: black; font-family: arial } h1, h2, h3, h4, h5, h6 { font-family: "Arial", "Verdana"; color: green } h1, h2, h3, h4, h5, h6 { font-family: "Arial", "Verdana"; color: green }
8
Including CSS ► Style sheets for an individual Web page Inline Styles Internal Style Sheet ► Style sheet for an entire site Multiple Style Sheets
9
Inline Styles This is a paragraph
10
Internal Style Sheets h1 { font-size:16pt; color: blue} This headline is blue and 16 pt. This headline is in standard H1 style.
12
Example body {background-color=yellow} h1 { font-size:16pt; font-family: "Verdana"; text-align: center; text-spacing: 4px; color: blue} p { font-size:12pt; font-family: "Verdana"; color: green} A title Some text A second title Some other text
14
Example <!-- body {background-color=green} h1 { font-size:16pt; font-family: "Verdana"; text-align: center; text-spacing: 4px; color: blue} p { font-size:12pt; font-family: "Arial"; font-weight: bold; color: yellow} --> A title Some text A second title Some other text
16
Popular and most-visited sites ► ► They contain needed information or provide an enjoyable diversion ► ► They load quickly ► ► They retain a consistent look throughout the site
17
One style sheet for multiple Web pages ► You have only to create a text file with the styles inside ► Do not include tags ► Save the file with.css filename extension
18
body {background-color=green} h1 { font-size:16pt; font-family: "Verdana"; text-align: center; text-spacing: 4px; color: blue} p { font-size:12pt; font-family: "Arial"; font-weight: bold; color: yellow} <link rel=stylesheet type="text/css" href=style1.css> A title Some text A second title Some other text style1.css Lesson8-3.htmLesson8-3.htm
19
http://www.w3schools.com/Css/css_intro.asphttp://www.w3schools.com/Css/css_intro.asp Examples of CSS usage …/demo_default.htm
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.