Slide 1 CMPS 211 Internet Programming Spring 2008 Style Sheet Building Blocks Chapter 7 & 8 4/8/08.

Slides:



Advertisements
Similar presentations
LIS901N: Style sheet Thomas Krichel Style sheets Style sheets are the officially sanctioned way to add style to your document We will cover.
Advertisements

CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Intro To Cascading Style Sheets By Mario Yannakakis.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
/k/k 1212 Cascading Style Sheets Part one Marko Boon
Today CSS HTML A project.
Project 8 Creating Style Sheets.
Introduction to CSS.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
INTRODUCTION TO HTML5 CSS Styles. Understanding Style Sheets  HTML5 enables you to define many different types of content on a web page, including headings,
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
WRT235: Writing in Electronic Environments Basic CSS.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
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,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 7: CSS Building Blocks.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
Cascading Style Sheets I Embedded Style Sheets. Page Design ICSS 2Instructor: Sean Griffin What is a Style Sheet? A style sheet is a text file that contains.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Relative, absolute, and Floating Positioning, Cascading Style Sheet, and Inheritance.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
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.
The Internet 10/11/11 Fonts and Colors
4.01 Cascading Style Sheets
CSS: Cascading Style Sheets
Chapter 6 Cascading Style Sheets™ (CSS)
Using Cascading Style Sheets Module B: CSS Structure
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
The Internet 10/13/11 The Box Model
Second CSS Lecture Applications to XML
>> Dynamic CSS Selectors
Cascading Style Sheets Color and Font Properties
The Internet 10/6/11 Cascading Style Sheets
Cascading Style Sheets™ (CSS)
More CSS 22-Feb-19.
Tutorial 3 Working with Cascading Style Sheets
Web Design & Development
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets
4.01 Cascading Style Sheets
Web Programming and Design
CS332A Advanced HTML Programming
Presentation transcript:

Slide 1 CMPS 211 Internet Programming Spring 2008 Style Sheet Building Blocks Chapter 7 & 8 4/8/08

Slide 2 CMPS 211 Internet Programming Spring 2008 Styles & Style Sheets A style sheet is a text file containing one or more rules that determine (using properties and rules) how certain elements in your web page should be displayed. We will use version CSS 2 Styles can be created outside the Web pages and then applied to all pages at once.

Slide 3 CMPS 211 Internet Programming Spring 2008 Style rules Selector Declaration Selector – the element that you wish to format Declaration – one or more property/value pairs h1 { color:red; } Img {border: 4px solid red} h1 { color: red; background: yellow;}

Slide 4 CMPS 211 Internet Programming Spring 2008 Style Rule Comments /* - begins a comment in a style sheet */ - Ends a comment in style sheet WHY? –Remember what style rules do –Help debug style sheets Can span several lines

Slide 5 CMPS 211 Internet Programming Spring 2008 “cascading” Every browser has its own default style rules Can write and apply style rules to a specific XHTML element in the code Insert them at the top of an XHTML doc Import one or more from an external file Some style rules are inherited from parent to child

Slide 6 CMPS 211 Internet Programming Spring 2008 Principle of the cascade Inheritance – some properties are inherited. See p122, Figs em element inherits font, weight, and color from parent, P element.Figs Specificity – the more specific the selector, the stronger the rule. Fig 7.8 shows four rules. Fig 7.9 shows application of the rules.Fig 7.8 Fig 7.9 If specificity is not enough, use location

Slide 7 CMPS 211 Internet Programming Spring 2008 Property’s value Inherit Predefined – not in quotationmarks Lengths and percentages – must have a quantity and a unit e.g. 3em or 10px –relative – em equal to font size; px relative to resolutionof the monitor –absolute – self-explanatory in, cm, mm, … –percentage colors – percent of red, green, blue

Slide 8 CMPS 211 Internet Programming Spring 2008 External style sheet Use a text editor (e.g. MS notepad) to create your style sheet. define the style rules save as text-only format with extension.css must be either linked or imported if it contains non-ASCII “encoding”

Slide 9 CMPS 211 Internet Programming Spring 2008 Using styles Link an external style sheet –in each XHTML page, put –offer alternate style sheets using title=“label” create an internal style sheet import external style sheets “external.css”; url(external.css) url(“external.css”); Can designate media-specific style sheets with media=“output” where output types can be: all, aural, braille, embossed, handheld, print, proejction, screen, tty and tv

Slide 10 CMPS 211 Internet Programming Spring 2008 Apply style locally embed the style=“ … “ in the element tag See p134 Fig18-19Fig18-19 Location of the style rules is very important in defining which rules apply.