+ All Categories
Home > Documents > Robert Vitolo CS430. CSS (Cascading Style Sheets) Purpose: To provide a consistent look and feel...

Robert Vitolo CS430. CSS (Cascading Style Sheets) Purpose: To provide a consistent look and feel...

Date post: 26-Dec-2015
Category:
Upload: damian-perry
View: 215 times
Download: 3 times
Share this document with a friend
Popular Tags:
19
Style Sheets Robert Vitolo CS430
Transcript
Page 1: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Style SheetsRobert Vitolo

CS430

Page 2: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Style Sheets: A Brief Overview

CSS (Cascading Style Sheets)

Purpose:

• To provide a consistent look and feel for a set of web pages

• To make it easy to update or manipulate the format or style of a page by separating style from content

Page 3: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Different Types External

• Style details are maintained in their own file, separate from the other code

Internal and Inline• Style elements are defined within the code• Override external style rules

ASP.NET has an added feature: Skins

Page 4: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Referencing an external style sheet

To reference an external style sheet in your webpage, you must code a link element within the head element of the page.

Page 5: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Creating a reference to a Style Sheet (Code)

Style Sheet Filename

Page 6: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Coding a reference to a Style Sheet (Automated)

You can also do this in an automated fashion, by going into the Design mode for your webpage, clicking on format and selecting ‘Attach Style Sheet’.

Page 7: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Creating a reference to a Style Sheet (Automated)

Page 8: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Creating a reference to a Style Sheet (Automated)

Page 9: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Creating a reference to a Style Sheet (Automated)

Page 10: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Creating a style sheet CSS sheets have a specific coding

format:

Selector { Property : value;

}

Example:h1 {

color: green;}

Defines all of the elements that will be impacted by the style

rule.

Page 11: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Selectors (Example)

Page 12: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Example Web Page (No Style Sheet)

Page 13: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

CSS Style Sheet Code Example

Page 14: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Webpage with style sheet attached

Page 15: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Visual Studio Environment Features

Visual Studio gives you some access to many of the CSS functions via the VS menus.

Page 16: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Visual Studio Environment Features

Page 17: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Visual Studio Environment Features

Page 18: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

New Style Dialog Box Allows you to add new style rules

without having to memorize all of the different properties and values – accessed through the Format menu.

Page 19: Robert Vitolo CS430.  CSS (Cascading Style Sheets)  Purpose: To provide a consistent look and feel for a set of web pages To make it easy to update.

Recommended