Cascading Style Sheets

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 4-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Advertisements

HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
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-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
CSS Cascading Style Sheets. What is CSS? CSS stands for Cascading Style Sheets (the page—or sheet—helps you create a style that will cascade across all.
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
/k/k 1212 Cascading Style Sheets Part one Marko Boon
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.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
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.
1/18 ITApplications XML Module Session 5: Extensible Stylesheet Language (XSL)
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
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.
Chapter 6 Web Typography
Week 7 Web Typography. 2 Understanding Type Design Principles.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Cascading style sheets (CSS)
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Chapter 6 Web Typography. 2 Principles of Web Design Chapter 5 Objectives Understand principles for type design on a Web site Use the element Understand.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
Professor Waterman Cascading Style Sheets (CSS) is a language that works with HTML documents to define the way content is presented. The presentation.
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.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
CSS.
Working with Cascading Style Sheets
Web Development & Design Foundations with XHTML
The Box Model in CSS Web Design – Sec 4-8
CS3220 Web and Internet Programming CSS Basics
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
The Box Model in CSS Web Design – Sec 4-8
Cascading Style Sheets
Web Development & Design Foundations with HTML5
Madam Hazwani binti Rahmat
CX Introduction to Web Programming
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Introduction to Web programming
The Box Model in CSS Web Design – Sec 4-8
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CSS Style Sheets: Intro
Stylin’ with CSS.
Web Programming– UFCFB Lecture 11
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
CS3220 Web and Internet Programming CSS Basics
CS3220 Web and Internet Programming CSS Basics
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
Stylin’ with CSS.
Cascading Style Sheets
Stylin’ with CSS.
Session IV Chapter 15 - How Work with Fonts and Printing
Introduction to Cascading Style Sheets (CSS)
Presentation transcript:

Cascading Style Sheets A presentation by Ray James for INF385E Information Architecture And Design Dr. Don Turnbull Nov. 15, 2005

Presentation Outline CSS basics & background CSS demonstration, uses, applications & tips Issues and limitations Questions & comments Nov. 15, 2005

Basics & Background of CSS What is a cascading style sheet? What can one do with them? Who created the concept? Who guides and maintains CSS? Nov. 15, 2005

CSS: basics CSS (acronym for Cascading Style Sheet) is style sheet language used to describe the presentation of a document written in a markup language. CSS styles web pages written in HTML and XHTML, but can also be applied to any application created using Extensible Markup Language (XML): Scalable Vector Graphics (SVG) XML User Interface Language (XUL) Learning XML by Erik T. Ray; Cascading Style Sheets, designing for the Web by Håkon Wium Lie and Bert Bos; and Wikipedia: http://en.wikipedia.org/wiki/Cascading_Style_Sheets Nov. 15, 2005

More CSS basics Key concepts of CSS: CSS defines colors, fonts, layout, and other aspects of document presentation Key concepts of CSS: Separates document structure from document presentation. CSS can control the document’s style separately in alternative rendering methods, such as on-screen, in print, by voice, and on Braille-based, tactile devices. The closer the style to the element, the more importance it carries. Benefits of separation of structure and presenation: Learning XML by Erik T. Ray; Cascading Style Sheets, designing for the Web by Håkon Wium Lie and Bert Bos; and Wikipedia: http://en.wikipedia.org/wiki/Cascading_Style_Sheets Nov. 15, 2005

Benefits of Using CSS Improved content accessibility (faster downloads) 2. Greater flexibility (examples: spacing, color, line height) 3. Control in specification of presentational characteristics 4. Reduced complexity of structural content compared to HTML 5. One-stop changes for small and large documents Nov. 15, 2005

CSS’s background Created in 1994 by Håkon Wium Lie at CERN (European Organization for Nuclear Research) Purpose: Create simple but expressive language that could combine styles from different sources First style sheets (SGML) in 1970s (embedded) Existing style sheets were powerful but big and complex, not really practical for Web Lie and others proposed a new standard Cascading Style Sheets, designing for the Web by Håkon Wium Lie and Bert Bos Nov. 15, 2005

CSS adoption, maintenance W3C* recommends first CSS in 1996 CSS2 released in 1998, added functionality & increased properties from about 50 to 120+ (CSS 2.1 2002) CSS3 work in process *World Wide Web Consortium maintains CSS specifications http://www.blooberry.com Nov. 15, 2005

Why is called “cascading”? Cascading effect of multiple style sheet rules. embedded http://www.abdn.ac.uk Nov. 15, 2005

What CSS does & how csszengarden CSS document provides rules for displaying HTML or XTML document with specific syntax: Selector: Specifies element of document Declaration: What property to apply Property: Defines an aspect of element Value: What quality to apply to property Nov. 15, 2005

Syntax example Selector Declaration Property Value /* A simple example/* addressbook { display-type: block; font-family: sans-serif; font-size: 12 pt; background-color: white; color: blue; } entry { border: thin solid black; padding: 5em; margin: 5em; name, phone, email, address { margin-top: 2em; margin-bottom: 2em; Selector Declaration Property Value Nov. 15, 2005 Page 174, Learning XML, Ray

Syntax example (2) Selector Declaration Property Value /* A simple example/* addressbook { display-type: block; font-family: sans-serif; font-size: 12 pt; background-color: white; color: blue; } entry { border: thin solid black; padding: 5em; margin: 5em; name, phone, email, address { margin-top: 2em; margin-bottom: 2em; Selector Declaration Property Value Page 174, Learning XML, Ray Nov. 15, 2005

Syntax example (3) Selector Declaration Property Value /* A simple example/* addressbook { display-type: block; font-family: sans-serif; font-size: 12 pt; background-color: white; color: blue; } entry { border: thin solid black; padding: 5em; margin: 5em; name, phone, email, address { margin-top: 2em; margin-bottom: 2em; Selector Declaration Property Value Page 174, Learning XML, Ray Nov. 15, 2005

Syntax example (4) Selector Declaration Property Value /* A simple example/* addressbook { display-type: block; font-family: sans-serif; font-size: 12 pt; background-color: white; color: blue; } entry { border: thin solid black; padding: 5em; margin: 5em; name, phone, email, address { margin-top: 2em; margin-bottom: 2em; Selector Declaration Property Value Nov. 15, 2005 Page 174, Learning XML, Ray

Using CSS 3 simple yet practical applications: Initial or drop caps Indenting paragraphs Confetti menu (headlines) From tables to CSS: redesigning Dr. Doom Nov. 15, 2005

Dr. Doom original Nov. 15, 2005

CSS for drop caps /* CSS Document */ .dropthecap {float:left; margin-top:0px; background-color:#FFFFFF; color:#339999; padding-top:.1em; font-size:36pt; height:.5em; font-weight:bold; font-family: "times","Times New Roman",serif;} www.mandarindesign.com Nov. 15, 2005

Drop cap applied Nov. 15, 2005

Paragraph Indent CSS p + p { text-indent: 1.5em; margin-top : 0 } http://www.w3.org/Style/ Nov. 15, 2005

Confetti menu (headlines) CSS DIV.map { padding-top: 190px; margin-left: -2em; /* Adapt this to your own page... */ margin-right: -2em; /* Adapt this to your own page... */ margin-bottom: 4em; margin-top: 5em; clear: both; text-shadow: 0.2em 0.2em /* 0.2em */ silver } #p1, #p2, #p3, { white-space: nowrap } #p1, #p2, #p3, { text-indent: 0 } #p1, #p1 A {color: #F73; font: bold 60px/1 "Verdana", sans-serif} #p2, #p2 A {color: #000; font: italic 40px/1 "Georgia", serif} #p3, #p3 A {color: #37F; font: bold 40px/1 Courier New, Courier, monospace} #p1 {text-align: left; margin: -185px 0 85px 0} #p2 {text-align: left; margin: -90px 0 70px 0} #p3 {text-align: left; margin: -80px 0 55px 0} Nov. 15, 2005

New Dr. Doom front page Nov. 15, 2005

CSS Issues & Limitations Inconsistent appearance in various browsers, platforms Complex information or information stored in order different from presentation often exceeds CSS capabilities Finite property sets Implementation among clients mixed Learning XML, Ray Nov. 15, 2005

Tips Order the items on your CSS style sheet in alphabetical order so you can find an element easily. Found a webpage design you like? Copy the CSS, then change it to fit your needs. Validate the CSS syntax before applying it to your HTML document but remember just because it’s valid doesn’t mean it’ll work or work the way you want it to work. Nov. 15, 2005

Resources Learning XML by Erik T. Ray Cascading Style Sheets, designing for the Web by Håkon Wium Lie and Bert Bos Wikipedia: wikipedia.org/wiki/Cascading_Style_Sheets www.mezzoblue.com www.csszengarden.com www.mandarindesign.com www.w3.org www.abdn.ac.uk www.blooberry.com CSS validator: jigsaw.w3.org Nov. 15, 2005

Comments, questions ? Nov. 15, 2005