Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lesson 5 Introduction to Cascading Style Sheets HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.

Similar presentations


Presentation on theme: "1 Lesson 5 Introduction to Cascading Style Sheets HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner."— Presentation transcript:

1 1 Lesson 5 Introduction to Cascading Style Sheets HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner

2 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 22 Objectives Create a Cascading Style Sheet. Control hyperlink behavior with CSS. Create style classes. Share style classes among Web pages. Control HTML table appearance with CSS.

3 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 33 Vocabulary active cascading style Cascading Style Sheet.css CSS files hover look and feel normal style style class style sheets visited

4 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 44 Introduction A style is simply a collection of one or more attributes that are applied to the visual components of a Web page. A cascading style is a collection of one or more attributes that can be specified once within the header of a Web page and then applied to many instances of a particular tag.

5 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 55 Creating Cascading Style Sheets A Cascading Style Sheet is a collection of one or more cascading style codes that has been extracted from the header of a Web page and stored in a separate file in a specific (CSS) format. CSS makes it possible to customize the appearance and behavior of the Web site simply by changing the values in the style sheets.

6 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 66 Creating Cascading Style Sheets (continued) Web page using a Cascading Style Sheet By convention, Cascading Style Sheet files are always given a.css extension.

7 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 77 Exploring Hyperlink Styles There are four possible states of a link. The normal state of a hyperlink is the way it appears when the mouse pointer is not over it and it has never been clicked. The hover state defines the link’s appearance when the mouse pointer is over it but has not yet been clicked.

8 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 88 Exploring Hyperlink Styles (continued) A link’s active state is when it has the focus on a Web page and pressing the mouse button gives it focus. The visited state specifies a link’s appearance after it has been clicked at least once.

9 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 99 Exploring Hyperlink Styles (continued) By default, many popular browsers display text hyperlinks in an underlined, blue font. Navigation bar with hover, active, and visited links

10 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 10 Working with Style Classes CSS technology allows you to define style classes that can be applied to certain tags without affecting other tags of the same type. A style class is a named group of attributes that are defined in a Cascading Style Sheet and that can be applied to specified tags within an HTML document.

11 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 11 Sharing Style Classes All that is required for two or more Web pages to share a style class is for these Web pages to link in the style sheet in which the style class is defined. Although not a requirement, this is often done when the Web pages sharing the class are all displayed in a common frameset.

12 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 12 Exploring Table Styles Tables support a variety of attributes that are used to define column widths, border thickness and style and other table features. HTML table using style classes

13 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 13 Exploring Table Styles (continued) Because it is common for Web designers to want different tables on their Web pages to have different attributes, this is a perfect opportunity to make use of style classes.

14 Lesson 5 Barksdale / TurnerHTML and JavaScript BASICS 4E 14 Summary In this lesson, you learned: How to create a Cascading Style Sheet. How to control hyperlink behavior with CSS. How to create style classes. How to share style classes among Web pages. How to control HTML table appearance with CSS.


Download ppt "1 Lesson 5 Introduction to Cascading Style Sheets HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner."

Similar presentations


Ads by Google