Tutorial 3 Introducing Cascading Style Sheets. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Pages Week 10 This week: CSS Next week: CSS – Part 2.
Project 8 Creating Style Sheets.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
Chapter 8 Creating Style Sheets.
Tutorial 5 Working with the Box Model. XP Objectives Understand the box model Create padding, margins, and borders Wrap text around an image Float a block-level.
XP Introducing Cascading Style Sheets With Cascading Style Sheets (CSS), you can create one or more documents that control the appearance of some or all.
Starting BBEdit (Notepad) and Opening an HTML File Open the Public Folder Start Notepad or BBEdit Click File on the menu bar, and then click Open In the.
Week 7 Web Typography. 2 Understanding Type Design Principles.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
CSS – CASCADING STYLE SHEETS Making your XHTML webpage look good.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Introducing Cascading Style Sheets  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles  Text Formatting with CSS.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
More HTML Chapter 4. 2 Nesting Tags How do you write the following in HTML? The wrong way: This is really, REALLY fun ! Tags must be correctly nested.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
CSS: Cascading Style Sheets. 2 What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Introducing Cascading Style Sheets. Cascading Style Sheet Basics  Cascading Style Sheet Basics  Creating Styles  Using Styles  Manipulating Styles.
Cascading Style Sheets Level 2. Course Objectives, Session 1 Level 1 Quick Review Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your.
Cascading Style Sheets Objective: Create an external style sheet, embedded style sheet, and an inline style to change the look and feel of a web site.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
OV Copyright © 2008 Element K Content LLC. All rights reserved.  Format Text  Format Lists  Format Images  Modify Page Background Applying Styles.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CSS Cascading Style Sheets *referenced from
Tutorial 3 Designing a Web Page with CSS
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Internet & World Wide Web How to Program, 5/e 1. 2.
HTML5 and CSS3 Illustrated Unit D: Formatting Text with CSS
Formatting Text with CSS
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Web Development & Design Foundations with HTML5
Madam Hazwani binti Rahmat
Using Cascading Style Sheets Module B: CSS Structure
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Cascading Style Sheets - Building a stylesheet
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2016 Terry Ann Morris, Ed.D.
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets
Introduction to Cascading Style Sheets (CSS)
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Tutorial 3 Introducing Cascading Style Sheets

XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write CSS styles Choose the correct style to format a Web page Create an embedded style sheet Understand how color is used on a Web page Make text bold and italic using CSS Specify fonts with the font properties Make text appear in small capital letters Use a shorthand property to write more concise code

XP Introducing Cascading Style Sheets Provides a way to easily and efficiently format an unlimited number of Web pages with a consistent appearance Offers many advantages: – Greater consistency in your Web site – Easily modified code – More flexible formatting – Greater functionality Cross-browser support allows CSS to appear in all Web browsers without any differences New Perspectives on Blended HTML, XHTML, and CSS3

XP Understanding How Styles Are Written A style is a consistent, recognizable pattern A CSS style is a collection of one or more rules A style sheet is a collection of styles A rule is the combination of a selector, a property, and a value The selector identifies the element to which you are applying a style. – Element, type, class, and id selectors New Perspectives on Blended HTML, XHTML, and CSS4

XP Creating a CSS Style In a text document, type the selector followed by a left brace, as in the following code, and then press the Enter key. selector { Type the declarations (each indented by two or three spaces), separating a property from a value with a colon. Type a semicolon after each declaration, and then press the Enter key, as in the following code. property: value; New Perspectives on Blended HTML, XHTML, and CSS5

XP Creating a CSS Style Type a right brace on its own line (but not indented) below the declaration list. The following code shows the complete syntax for a rule: selector { property: value; } New Perspectives on Blended HTML, XHTML, and CSS6

XP Understanding How Styles Are Written New Perspectives on Blended HTML, XHTML, and CSS7

XP Working with Color The color property changes the foreground color of an element The background-color property changes the background color of an element You can define color in three ways: – By name – By their RGB triplet – By a hexadecimal value New Perspectives on Blended HTML, XHTML, and CSS8

XP Working with Color New Perspectives on Blended HTML, XHTML, and CSS9

XP Creating an Embedded Style Sheet An embedded style sheet is one in which the CSS code is written in the section of an XHTML document On a blank line in the section of an XHTML document, type: Press the Enter key four times Type the end tag Position the insertion point on the blank line between the start and end tags Type the CSS code New Perspectives on Blended HTML, XHTML, and CSS10

XP Creating an Embedded Style Sheet The following code shows the syntax for an embedded style sheet:... CSS code is typed here... New Perspectives on Blended HTML, XHTML, and CSS11

XP Creating an Embedded Style Sheet New Perspectives on Blended HTML, XHTML, and CSS12

XP Grouping Element Selectors Grouped selectors are selectors with the same declarations grouped into a comma-separated list New Perspectives on Blended HTML, XHTML, and CSS13

XP Using Descendant Selectors A descendant selector is a selector nested within another selector New Perspectives on Blended HTML, XHTML, and CSS14

XP Using Font Properties New Perspectives on Blended HTML, XHTML, and CSS15

XP Using Font Properties The font-variant property can make text appear in small caps New Perspectives on Blended HTML, XHTML, and CSS16

XP Using Font Properties The font-size property is used to change the font size You can express font size in: – Centimeters – Inches – Millimeters – Points – Picas – Pixels – X-Height – em – Percentage New Perspectives on Blended HTML, XHTML, and CSS17

XP Using Font Properties Em units and percents are examples of a relative value, a value that increases or decreases in size in relation to its parent element Point values are an absolute value, a fixed value that will not increase or decrease in size in relation to its parent element New Perspectives on Blended HTML, XHTML, and CSS18

XP Using Font Properties The font-family property is used to change the typeface of text A font family is a set of fonts that have similar characteristics – Fonts you see depend on the platform Generic font New Perspectives on Blended HTML, XHTML, and CSS19

XP Using Font Properties New Perspectives on Blended HTML, XHTML, and CSS20

XP Using the Font Shorthand Property Following the selector and the left-facing bracket, type font: on its own line, as shown in the following code: h2 { font: Type values for the font’s style, weight, variant, size, and family as applicable. Enter spaces between the values for the font properties. Enter commas between values for the font family. New Perspectives on Blended HTML, XHTML, and CSS21

XP Using the Font Shorthand Property The following code shows the syntax for a completed rule: h2 { font: normal bold 1.4em Verdana, Helvetica, sans-serif; } New Perspectives on Blended HTML, XHTML, and CSS22

XP Validating a File for CSS Code To validate a file to see if the CSS code meets the standard: – Open your browser and navigate to – If necessary, click the By file upload tab – Click the Browse button. Navigate to the storage location of the file to be validated – Double-click the filename to enter it in the Local CSS file text box – Click the Check button New Perspectives on Blended HTML, XHTML, and CSS23

XP Validating a File for CSS Code New Perspectives on Blended HTML, XHTML, and CSS24