Cascading Style Sheets Robin Burke ECT 360. Outline Midterm CSS CSS selection Positioning SVG Final project.

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

Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Cascading Style Sheets
Today CSS HTML A project.
กระบวนวิชา 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.
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
© Nova / Grassioulet 5-6 mai 2002 TECFA staf2x S V G glossary Scalable Vector Graphics.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Cascading Style Sheets Controlling the Display Of Web Content.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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,
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
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.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
The Characteristics of CSS
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
CSS – Presentation of Information. Types of Style Sheets External Embedded h1{color:red; font-family: Arial;} Inline Text is here.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
I NTRO TO CSS IAT100 Spring I NTRO TO CSS Covered in this lesson: Overview What is CSS? Why to use CSS? CSS for Skinning your Website Structure.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 7.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
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.
SVG for Designers Tom Hoferek. Objectives Introduce SVG Illustrate its capabilities Demonstrate SVG in action Speculate, discuss, answer questions.
Lecture 16 Image Document Formats. Bitmap vs. Vector Images Bitmaps do not generally.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
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,
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 6.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
JavaScript IV Robin Burke ECT 270. Outline Final project reminder Style review Manipulating style Special effect examples.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
© Dr. Graham Rollings Dr. Graham Rollings, 09 June 2016 HTML & CSS A very High-level Introduction.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
HTML 5 AND CSS Dr Mohd Soperi Mohd Zahid Semester /16.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 8.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
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.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
Creating Web Documents CSS examples (do more later) Lab/Homework: Read chapters 15 & 16. Work on Project 3, do postings.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
Internet & World Wide Web How to Program, 5/e 1. 2.
Cascading Style Sheets
Working with Cascading Style Sheets
Inserting and Working with Images
Tutorial 6 Creating Dynamic Pages
More CSS 22-Feb-19.
Presentation transcript:

Cascading Style Sheets Robin Burke ECT 360

Outline Midterm CSS CSS selection Positioning SVG Final project

Midterm 2/2 5:45 pm open book

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

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

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

XHTML example

CSS in XML XML is a data-interchange language not intended for display CSS can be used must provide all display information

CSS in XML, cont'd HTML distinguishes in-line vs block elements vs crucial for layout XML has no such distinction

Display attribute block display content in a separate chunk in-line display content as part of the parent element list-item display content as part of a list none hide content

Inheritance Elements inherit their styles setting a style for the "body" element changes the whole document same true for parent elements in XML

Embedded style style is declared within a given XML document plus style information centralized minus can't be reused on other documents no standardized way to do this

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

Stylesheet linking Processing instruction information for the rendering application not part of the document content Syntax

Examples external style

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

CSS Rules: Selectors any element name element with particular attribute foo[bar="baz"]  not implemented in IE 6.0 element relationships a b a > b a + b designer-defined classes

CSS Pseudo-elements Pseudo-elements a class name that is pre-defined but isn't a tag Example first-line first-letter Also not implemented in IE 6.0

Examples section section-number {font-weight: bold; } section[type="night"] { color: blue; } instructor:first-letter { font-size:large; color: red; }

CSS Classes and Ids A class is a user-defined name identifies certain elements for styling in document, in stylesheet, foo.bar ID must be unique in document use for identify a single element to have a particular style #id

Examples #me { font-weight: bold; } section.day { color: red; } section.night { color: blue; }

Alignment and positioning padding border margin Block-level element

Layering Boxes can overlap each other transparent regions will show through layering negative margin does this Boxes can be positioned absolutely also causes layering position: absolute specific position on page

Example

Break

SVG Scalable Vector Graphics Graphics graphical display of all sorts even UI Vector as opposed to "raster" Scalable important for multi-platform

SVG XML application Based on "paint/canvas" model A graphic is a set of painting operations layered on top of each other

Viewing SVG Browser plug-in Adobe (best) Corel Drawing tools CorelDraw Adobe Illustrator

Basic tools text line rect circle ellipse path

Attributes x, y start position fill the color of the contents stroke the color of the line / edge many others

Simple example a box containing text <rect fill="blue" stroke="black" stroke-width="5" x="0" y="0" width="475" height="75"/> <text x="10" y="20" fill="white" font-size="18"> Hello world

A more complex example course logo

HTML embedding

Scalability All images are pixels rasterization When are pixels created? jpg, gif, png, etc. at creation time svg at display time Benefits no loss of clarity at high scale smaller files esp. for simple drawings

Example scaling JPEG vs SVG

Path a way to represent complex shapes straight line curved

Example ducks

Abstract path A path need not be drawn Can be used to arrange other elements esp. text

Path example course logo with textPath

Grouping and transforming g element is used to group elements Reasons apply an attribute to all define a new coordinate system transform the group

Transform examples Coordinate shift Skew

Combining CSS and SVG SVG elements can have CSS styles applied Internal or external style Familiar properties color, font-family, etc. also SVG specific fill, stroke, fill-opacity, etc.

CSS example course logo internal course logo external

Linking With images clickable image maps But image map separate from image

Linking, cont'd A element as in HTML but based on XLink standard Example Clicking in the rectangle goes to URL

Linking example course logo with link

Filters Graphical effects created by filters Can be applied under SVG control A complex topic Filter effects blur lighting compositing blending convolution noise, etc.

Filter example course logo with specular effect Steps get the silhouette of the image and blur it offset blur to create shadow apply lighting to blur to get highlight trim highlights to fit image add highlight back to original image combine with shadow

Scripting SVG graphics can be scripted using JavaScript / ECMAScript Same techniques as used in HTML event handling via onclick, onmouseover, ec. Difference now interacting with SVG DOM not HTML DOM

Scripting examples course logo with roll-over mines

Animation SVG also supports animation uses some ideas from SMIL

Animation example course logo spinning

Final project XML application your choice should have 50 objects Schema Transformations full listing summary SVG Display controlled by CSS

Final project, cont'd

Milestones 2/6 team domain 2/23 schema draft document draft 3/15 final presentation

Next week Midterm open book, notes covers XML syntax validation CSS SVG