Web-based Application Development Lecture 5 January 24, 2006 Anita Raja.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Computer Applications II.  A Style Sheet is a web page development tool that allows the developer to make global changes to a web page (or web site)
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.
Chapter 8 Creating Style Sheets.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
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.
Week 7 Web Typography. 2 Understanding Type Design Principles.
Web-based Application Development Lecture 4 January 19, 2005 Anita Raja.
Cascading Style Sheets (CSS) Why do we need them? Separate structure from browser presentation There are many HTML presentation attributes –We want to.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
4.01 Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
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,
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 09: Cascade Style Sheets - Spring 2011.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
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.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
CO1552 – Web Application Development Cascading Style Sheets.
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.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
ATTRIBUTES, LISTS, AND TABLES. Chapter 4 Objectives Extensions Strict vs. transitional XHTML Tag options Structure lists Table data.
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
DIV, Span, CSS.
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
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.
Lecture 15 ITIS 2300 Mid Term Review February 28, 2006 Dr. Anita Raja.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
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,
Introduction to CSS. What is CSS? CSS ("Cascading Style Sheets") determines how the elements in our XHTML documents are displayed and formatted. By using.
Cascading Style Sheets Web Design Fairport High School.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
Tutorial 3 Designing a Web Page with CSS
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
Formatting Text with HTML and CSS. Summary block-level elements. Character-level elements Logical and physical style Special elements: hr,address, quotation.
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
Formatting with Styles. Choosing a Font Family font-family property has a special characteristics: you can specify more than one font h1, h2 {font-family:”Arial.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Madam Hazwani binti Rahmat
Using Cascading Style Sheets Module B: CSS Structure
Programming the Web using XHTML and JavaScript
Programming the Web using XHTML and JavaScript
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Tutorial 3 Working with Cascading Style Sheets
Presentation transcript:

Web-based Application Development Lecture 5 January 24, 2006 Anita Raja

Agenda Cascading Style Sheets PTW Chapter 3 Attributes, Lists, and Tables PTW Chapter 4

Programming the Web using XHTML and JavaScript Chapter 3 Cascading Style Sheets

I’ll bet red headings would look nice

Internal Style Sheets Redefines the presentation rule (style) for certain elements “Internal” because contained within the HTML source document itself Styles may be defined using different style sheet languages so … … the language used must be specified

Internal Style Sheets element in section … The style sheet instructions in this element are: Written in plain text format Using the cascading style sheet language

Internal Style Sheets Also specify default style sheet language for entire HTML document: elements go in the section

Internal Style Sheets h2 { color:red } Style definition Name of tag Property Value

Internal Style Sheets h2 { color:#D61130 }

Internal Style Sheets Alignment Options are: left, center, right, justify h2 {color:red; text-align:center}

Uh, oh. I need bigger section headings

Formatting Fonts Using Styles Could find & replace all with Why not? What if some had been used for other things?

Formatting Fonts Using Styles Use font-size property: h2 {color:red; text-align:center; font-size:24pt}

Formatting Fonts Using Styles Other choices for font-size value: 150% smaller small, x-small, xx-small larger large, x-large, xx-large

Formatting Fonts Using Styles Use font-style property: h2 {… font-style:italic …}

Also normal, oblique

Formatting Fonts Using Styles Other properties text-decoration underline, overline, line-through, blink, none text-transform capitalize, uppercase, lowercase, none font-variant small-caps, none background-color transparent, one of the color names or numbers

Formatting Fonts Using Styles Paragraph styles Only works for content enclosed within elements p {font-size:14pt}

Formatting Fonts Using Styles Indent and line spacing: p {text-indent:25pt; line-height:24pt} p {text-indent:12%; line-height:150%}

Formatting Fonts Using Styles Font Families What if not installed on user’s browser? p {font-family:”Lucida”}

Formatting Fonts Using Styles Include more than one font families: p {font-family:”Lucida”,”Arial”}

Formatting Fonts Using Styles Warning: multiple fonts may not have the impact you intend User’s display may not include the fonts you specified Common fonts may be the best choice overall

Formatting Fonts Using Styles Can compress definition p {font-style:italic; font-weight:500; font-variant:small-caps; font-size:14pt; line-height:24pt; font-family:”Lucida”,”Arial”} p {font: italic 500 small-caps 14pt/24pt ”Lucida”,”Arial”}

Do all paragraphs have to be the same?

Tags with Multiple Styles The same type of element can have multiple definitions called “classes” p {text-align:justify; font-weight:bold} p.intro {text-align:center; color:red}

Tags with Multiple Styles The p.intro class includes the styles of the p class but changes those styles How is this class invoked? Explains why “none” is an option text-transform; font-variant …

Local Styles Local styles take precedence over other style definitions The text in this paragraph will The text in this paragraph won’t be red

No existing tag is quite right. Now what?

Custom Tags Can create entirely new elements Generic tags: (block level) (inline)

Custom Tags span {font-size:18pt} Let me make something perfectly clear.

Custom Tags Classes may be defined for custom tags span.red {color:red}

I’m going to get tired of entering style definitions into all my web pages.

External Style Sheets Text-only file Contains style definitions only h2 {color:red} h1 {font-size:24pt p {text-align:center} p.small {font-size:10pt} No tags needed

External Style Sheets Save in a file with a.css extension css = cascading style sheets Local, internal and external may be present in the same document Local overrides internal Internal overrides external

External Style Sheets How to specify external style sheets? Add tag in section

External Style Sheets Problem: older versions of browsers might not recognize style definitions Could use comments: <!-- p {text-indent:25pt; line-height:24pt} -->

External Style Sheets MORE problems: XHTML may not recognize this use of comments Solution: use method If older version of browser does not recognize this tag it will ignore it

Assignment Debugging Exercise, p. 81 Correct errors Post corrected document to your Web space as “Lagerstrom-Ch-3.html” Grade based on: Appearance Technical correctness of code

Chapter 4 Attributes, Lists, and Tables Programming the Web using XHTML and JavaScript

Extensions and Deprecations Extensions – features not found in “standard” HTML Too often, NN’s extensions don’t work in IE and vice versa Therefore, be careful about non-standard features Official features listed at

Extensions and Deprecations Deprecation – feature being phased out May work in older browser versions but eventually will cease to be supported Obsolete – features that are not supported by browsers in strict compliance with W3C standards

Extensions and Deprecations At … Site Index H HTML 4.01 Specification A. Changes 3.1 Deprecated Elements

Extensions and Deprecations Forms of XHTML (see p. 85) Strict Does not recognize deprecated elements Transitional Which should you use? Transitional Otherwise older browsers won’t display your pages well

Extensions and Deprecations vs. is deprecated isn’t Which would be preferable for making changes to an entire document?

Tags and Attributes Styles have properties h2 {text-align:center} Attributes have values … No quotation marks Quotation marks

Tags and Attributes size= “1” to “7” (smallest to largest) color= “red”, “blue”, etc. face= “Arial”, “Courier”, etc.

Tags and Attributes Alignment = “left”, “center”, “right” Using tags: Centering this text is centered

Tags and Attributes Preferred method using styles: h2 {text-align:center} p {text-align:center}

Tags and Attributes Background colors tag bgcolor and text attributes Using tags:

Tags and Attributes Using styles in the body: body {background-color:yellow; color:blue}

Tags and Attributes Horizontal rules Using tags: Using styles: hr {height:7px; width:75%; background-color:red} Ch04-Ex-01

Next Class HW 2 due 2 debugging assignments Complete Chapter 4 PTW Chapter 2 WWG