Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.

Slides:



Advertisements
Similar presentations
Week 7 Web Typography. 2 Understanding Type Design Principles.
Advertisements

Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
CSS: Cascading Style Sheets. What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
CSS: Cascading Style Sheets. 2 History HTML tags were originally designed to define the content of a document. The layout of the document was supposed.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
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,
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 09: Cascade Style Sheets - Spring 2011.
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)
1Computer Sciences Department. And use
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
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.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
Part 1: CSS - Why? - How it works - Writing rules - Examples.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
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.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
Cascading Style Sheets II Robin Burke ECT 270. Outline Midterm solution CSS review CSS selection selectors pseudo-classes classes, ids div and span Final.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
The Web Wizard’s Guide To DHTML and CSS Chapter 1 A Review of CSS1.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
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 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
CS 174: Web Programming September 9 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
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,
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
Developing Web Applications with HTML and CSS “Selectors and Properties”
CSS: Cascading Style Sheets Part II. Style Syntax.
1 CSS: Cascading Style Sheets W3Schools CSS tutorialCSS tutorial.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 6.
CSS Cascading Style Sheets *referenced from
Font-Family, Color and Background. Basics  CSS rule: Selector (multiple separated by, ) Declaration (multiple separated by ; ) Example: p { color: red;
Tutorial 3 Designing a Web Page with CSS
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
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.
Links All CSS properties can be applied on links (i.e. change colors, fonts, underline, etc). The new thing is that CSS allows you to define these properties.
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.
Cascading Style Sheets
CS3220 Web and Internet Programming CSS Basics
Introducing :CSS Cascading Style Sheets in 5 Lessons.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CS3220 Web and Internet Programming CSS Basics
Presentation transcript:

Cascading Style Sheets Robin Burke ECT 270

Outline CSS properties Fonts Alignment Color CSS selection selectors

The Great Layout Debate Purist W3C Pragmatist web designers

A solution A separate standard for defining style Styles can be defined at different places document site local device or client user preference

What is a style? An association between a set of display properties a logical unit of HTML content Not document content Some exceptions numbered lists, captions, etc.

Result HTML goes back to defining structure Layout and display decisions encoded in the stylesheet Designer can easily change page format without affecting HTML

Cascading Author User Client Also possible to label styles as "important"

Inheritance Elements inherit their styles setting a style for the "body" element changes the whole document We will ignore the style sheet cascade in this class

In-line styles part of individual tags plus benefits of new CSS attributes style declared where it is used minus doesn't separate content from display global changes not simplified

Embedded style style is declared within a given page plus style information centralized minus can't be reused on other pages

External a separate document "style sheet" is used documents link to the style sheet plus style can be shared across pages minus another document to manage & distribute

Structure of CSS selector { attribute:value; } Example h1 { font-color:blue; } Multiple attribute/values pairs possible

Examples in-line style embedded style linked style

CSS Rules: Fonts Fonts are very complex platform-specific copyrighted different standards Multi-dimensional size weight style ornament family

Font families Categories serif sans-serif monospace cursive Specific fonts Times Roman Arial Courier

font-family styles Best practice PC font, Mac font, generic font; Example font-family: Arial, Helvetica, sans-serif; font-family: Times Roman, serif;

Font sizes Options Relative Absolute Units in, px, em, pt, pc Examples font-size: larger font-size: 12 pt font-size: 50 px font-size: small

Spacing Can control letter and line spacing letter-spacing word-spacing line-height

Alignment text-align horizontal alignment like "align" attribute vertical-align like "valign" attribute but more possibilities

Other font style choices text-weight controls boldness text-decoration underlining, strike-through text-transform uppercase, lowercase font-variant small-caps font-style italic

CSS Rules: Colors What can be colored? text background links Options color names RGB triplets hex or decimal

Text and link color color changes the text color example color: rgb(153,102,6) color: #FFEECC links can have state-dependent colors link – unvisited visited – visited active – while being clicked hover – while the cursor is there

Link colors Handled via "pseudo-classes" relative to a element a:link a:visited Example a:link { color: red; } a:visited { color: blue; }

Link color example a:link { color: red; } a:visited { color: blue; text-decoration: none; } a:active { font-weight: bolder; } a:hover { color: green; }

Background color Background of any element can be set not true in HTML

Background images limited in HTML either large or tiled With CSS Total control over the background image

Example Background options

Lists can choose different kinds of bullets can control nesting behavior Example

CSS Rules: Selectors any html element name element with particular attribute td[align="center"]  not implemented in IE 6.0 element relationships a b b is a child of a a > b b is some descendant of a a + b b follows a (sibling) designer-defined classes

CSS Pseudo-elements Pseudo-elements a class name that is pre-defined but isn't an HTML tag Example first-line first-letter

Midterm What to study Fundamentals client/server interaction how the web works HTML topics Basics Tables Forms CSS not on exam

Next week Midterm More CSS