1 Lecture 7 Style Sheets: CSS. 2 Motivation HTML markup can be used to represent –Semantics: h1 means that an element is a top-level heading –Presentation:

Slides:



Advertisements
Similar presentations
Table, List, Blocks, Inline Style
Advertisements

Intro to HTML. HTML HTML = HyperText Markup Language Used to define the content of a webpage HTML is made up of tags and attributes Content.
Introduction to HTML & CSS
Cascading Style Sheets (CSS)
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 (CSS) “Styles” for short. Pg. 418.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
© 2004, Robert K. Moniot Chapter 6 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)
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Timing in XML XML and XSL Timing framework in XML Approaches Inline syntax (SMIL) Styled Timing Timesheets Timesheets and SMIL comparison.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 3 Style Sheets: CSS WEB.
Markup Languages Controlling the Display Of Web Content.
Timing in XML Timing framework in XML Approaches Inline syntax (SMIL) Styled Timing Timesheets Timesheets and SMIL comparison.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
Cascading Style Sheets Controlling the Display Of Web Content.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 3 Style Sheets: CSS WEB.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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,
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
Cascading Style Sheets (CSS) CSI 3140 WWW Structures, Techniques and Standards.
Pre-Module CSS BTM 395: Internet Programming. Cascading Style Sheets (CSS) Separation of structure from presentation CSS guide and tutorial –
Basics of HTML.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
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) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Syntax & Semantics Instructor: Joseph DiVerdi,
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
Copyright 2007, Information Builders. Slide 1 Understanding Basic HTML Amanda Regan Technical Director June, 2008.
© 2011 Delmar, Cengage Learning Chapter 8 Using Styles and Design Style Sheets for Design.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Intro To Web Design with Adobe Dreamweaver CSS Cascading Style Sheets (CSS) is the W3C standard for defining the presentation of documents written in HTML,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Introduction to CSS Brendan Knight. What is CSS Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (the.
CSS (Cascading Style Sheet)
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
Chapter 03 Cascading Style Sheets (CSS) IT2353 Web Technology.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Introduction. MIS 5450 Behavioral Layer JavaScript and DOM Structural Layer XHTML Presentation Layer CSS Design Development Process.
HTML5 and CSS3 Illustrated Unit C: Getting Started with CSS.
Cascading Style Sheets (CSS). Motivation HTML markup can be used to represent –Semantics: h1 means that an element is a top-level heading –Presentation:
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.
Introduction to CSS: Selectors
Getting Started with CSS
CSS: Cascading Style Sheets
>> Introduction to CSS
IS 360 Declaring CSS Styles
Chapter 3 Style Sheets: CSS
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
Website Design 3
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets (Introduction)
Cascading Style Sheets (Introduction)
HTML / CSS Mai Moustafa Senior Web Designer eSpace eSpace.
Chapter 6 Introducing Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets - Building a stylesheet
External Style Sheets.
Presentation transcript:

1 Lecture 7 Style Sheets: CSS

2 Motivation HTML markup can be used to represent –Semantics: h1 means that an element is a top-level heading –Presentation: h1 elements look a certain way It’s advisable to separate semantics from presentation because: –It’s easier to present documents on multiple platforms (browser, cell phone, spoken, …) –It’s easier to generate documents with consistent look –Semantic and presentation changes can be made independently of one another (division of labor) –User control of presentation is facilitated

3 Style Sheet Languages Cascading Style Sheets (CSS) –Applies to (X)HTML as well as XML documents in general –Focus of this chapter Extensible Style-sheet Language (XSL) –Often used to transform one XML document to another form, but can also add style –XSL Transformations covered in later chapter

4 CSS Introduction A styled HTML document produced by the style sheet style1.css :

5 CSS Introduction link element associates style sheet with doc.

6 CSS Introduction type attribute specifies style language used

7 CSS Introduction href attribute provides style sheet URL

8 CSS Introduction title attribute provides style sheet name

9 CSS Introduction

10 CSS Introduction Alternative, user selectable style sheets can be specified

11 CSS Introduction A styled HTML document produced by the style sheet style2.css :

12 CSS Introduction Single document can be displayed on multiple media platforms by tailoring style sheets: This document will be printed differently than it is displayed.

13 CSS Syntax Parts of a style rule (or statement)

14 CSS Syntax: Selector Strings Single element type: Multiple element types: All element types: Specific elements by id:

15 CSS Syntax: Selector Strings Single element type: Multiple element types: All element types: Specific elements by id: type selector

16 CSS Syntax: Selector Strings Single element type: Multiple element types: All element types: Specific elements by id: universal selector

17 CSS Syntax: Selector Strings Single element type: Multiple element types: All element types: Specific elements by id: ID selector

18 CSS Syntax: Selector Strings

19 CSS Syntax: Selector Strings Elements belonging to a style class: –Referencing a style class in HTML: Elements of a certain type and class: class selector

20 CSS Syntax: Selector Strings Elements belonging to a style class: –Referencing a style class in HTML: Elements of a certain type and class: this span belongs to three style classes

21 CSS Syntax: Selector Strings Elements belonging to a style class: –Referencing a style class in HTML: Elements of a certain type and class: this rule applies only to span ’s belonging to class special

22 CSS Syntax: Selector Strings Source anchor elements: Element types that are descendents: pseudo-classes

23 CSS Syntax: Selector Strings Source anchor elements: Element types that are descendants: rule applies to li element that is

24 CSS Syntax: Selector Strings Source anchor elements: Element types that are descendants: rule applies to li element that is part of the content of an ol element

25 CSS Syntax: Selector Strings Source anchor elements: Element types that are descendants: rule applies to li element that is part of the content of an ol element that is part of the content of a ul element

26 CSS Syntax Style rules covered thus far follow ruleset syntax At-rule is a second type of rule –Reads style rules from specified URL –Must appear at beginning of style sheet URL relative to style sheet URL

27 Style Sheets and HTML Style sheets referenced by link HTML element are called external style sheets Style sheets can be embedded directly in HTML document using style element Most HTML elements have style attribute (value is list of style declarations)

28 Style Sheets and HTML Rules of thumb: –Use external style sheets to define site-wide style –Prefer style sheets (either external or embedded) to style attributes –XML special characters Must use references in embedded style sheets and style attribute Must not use references in external style sheets

29 End of Lecture 7