CS105 INTRODUCTION TO COMPUTER CONCEPTS CASCADING STYLE SHEETS (CSS) Instructor: Cuong (Charlie) Pham.

Slides:



Advertisements
Similar presentations
© 2007 Triune Group Insight. Strategy. Performance. Cascading Style Sheets (CSS) An Introduction Chris Poteet.
Advertisements

CSS Digital Media: Communication and design 2007.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Week 7 Web Typography. 2 Understanding Type Design Principles.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
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
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.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
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.
CSS Dvijesh Bhatt.
Cascading style sheets (CSS)
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.
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.
1Computer Sciences Department. And use
Basics of Smarajit Dasgupta.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
Tutorial 6 By Sam INE 1020 Introduction to Internet Engineering 1 DHTML & CSS Tutorial 6.
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.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT Fall
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CO1552 – Web Application Development Cascading Style Sheets.
Cascading Style Sheet Bayu Priyambadha, S.Kom. Definition Cascading Style Sheets (CSS) form the presentation layer of the user interface. –Structure (HTML)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
XHTML and CSS. The Browser The browser is not print!
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
CSS WORKSHOP Design Principles for Web Standards.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Lesson 15: Cascading Style Sheets. Objectives Identify ways to apply Web page formatting with Cascading Style Sheets (CSS1 and CSS2) using various methods.
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.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
CSS: Cascading Style Sheets Part II. Style Syntax.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
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.
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.
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
4.01 Cascading Style Sheets
4.01 Cascading Style Sheets
Presentation transcript:

CS105 INTRODUCTION TO COMPUTER CONCEPTS CASCADING STYLE SHEETS (CSS) Instructor: Cuong (Charlie) Pham

Definition  Cascading Style Sheets (CSS) form the presentation layer of the user interface.  Structure (XHTML)  Behavior (Client-Side Scripting)  Presentation (CSS)  Tells the browser agent how the element is to be presented to the user.

Why CSS?  CSS removes the presentation attributes from the structure allowing reusability, ease of maintainability, and an interchangeable presentation layer.  HTML was never meant to be a presentation language. Proprietary vendors have created tags to add presentation to structure.   CSS allows us to make global and instantaneous changes easily.

The Cascade  The power of CSS is found in the “cascade” which is the combination of the browser’s default styles, external style sheets, embedded, inline, and even user-defined styles.  The cascade sets priorities on the individual styles which effects inheritance.

CSS Inheritance  Allows elements to “inherit” styles from parent elements.  Helpful in reducing the amount of CSS to set styles for child elements.  Unless a more specific style is set on a child element, the element looks to the parent element for its styles.  Each style has a numeric specificity value that is given based on its selector.

Using Style Sheets  External Style Sheet  Also a “media” descriptor (screen, tv, print, handheld, etc)  Preferred method.  Embedded Styles body {}  Inline Styles Inline Style Example

CSS Syntax selector/element { property: value; } The selector can either be a grouping of elements, an indentifier, class, or single XHTML element (body, div, etc)

Type (Element) Selector Specify the style(s) for a single XHTML element. body { margin: 0; padding: 0; border-top: 1px solid #ff0; }

Grouping Elements Allows you to specify a single style for multiple elements at one time. h1, h2, h3, h4, h5, h6 { font-family: “Trebuchet MS”, sans-serif; }

The Class Selector This is my introduction text.intro { font: 12px verdana, sans-serif; margin: 10px; }

The Identifier Selector This is my introduction text #intro { border-bottom: 2px dashed #fff; }

CSS Selectors  Identifier or class? What’s the difference?  An identifier is specified only once on a page and has a higher inheritance specificity than a class.  A class is reusable as many times as needed in a page.  Use identifiers for main sections and sub-sections of your document.

Advanced CSS Selectors  Descendant Selector body h1 { } #navigation p {}  Adjacent Sibling Selectors p.intro + span {}  Child Selectors div ol > p {}  Universal Selector * {} Attribute Selectors div[href=“  Pseudo-Class Selectors a:active {} #nav:hover {}

The Box Model  Every element in the DOM (Document Object Model) has a conceptual “box” for presentation.  The box consists of margin, padding, border, content (width, height), and offset (top, left)

CSS and Semantic Web  CSS aids in increasing the semantic value of the web content.  Increasing the semantic value of content aids in accessibility, and it is integral in the move away from (X)HTML to XML driven applications.  An example would be using an unordered list for navigation instead of a table.  Navigation is truly a “list” of information and not tabular data.

CSS Browser Acceptance  The advent of modern browsers (IE 5.5+, Firefox 1.5+, Safari 2+, Opera) has eliminated the fear of effectively utilizing CSS.  There remain certain selectors and attributes that vary in browser acceptance, but IE7, FF 2, Safari 3 all accept the CSS 2.1 specification.  There no longer remains any excuse not to utilize CSS in your application.

CSS Fonts  Font-family  Font-weight  Font-style  Font-size

CSS Units & Colors  Units  %  in  cm  mm  em  px  pt  Colors  color name (red, etc)  rgb(x,x,x)  #rrggbb (HEX)

CSS Layout  Margin  Padding  Border  Z-index  Positioning  Width  Height  Float  Text-align  Vertical-align

CSS vs Table Layouts  Tables are designed only for tabular data and not for layout.  Reduces semantic value of markup  Makes updating difficult and impractical  CSS allows positioning that reduces overall markup size, form, and allows layout to be changed by only editing a stylesheet.  CSS layouts also improve accessibility, because screen readers turn off style sheets allowing only the content to remain.

CSS Text  Text-indent  Text-align  Text-decoration  Letter-spacing  Text-transform  Word-spacing  White-space

CSS Background  Background-color  Background-image  Background-position  Background-repeat

CSS Lists  List-style  List-style-image  List-style-position  List-style-type

CSS Shorthand  Consolidates many styles into a single declaration. font-family: verdana, sans-serif; font-weight: bold; font-size: 12px;  font: bold 12px verdana, sans-serif; padding-top: 5px; padding-right: 8px; padding-bottom: 5px; padding-left: 10px;  padding: 5px 8px 5px 10px;

CSS and Accessibility  Section 508 Standards  “Web pages shall be designed so that all information conveyed with color is also available without color, for example from context or markup.” ( C)  “A text-only page, with equivalent information or functionality, shall be provided to make a web site comply with the provisions of this part, when compliance cannot be accomplished in any other way. The content of the text-only page shall be updated whenever the primary page changes.” ( K)  By moving all presentation into style sheets and removing tables from layout the content is presented in an optimal manner to screen readers and other accessibility tools.  CSS 2.1 has “aural” properties that can be applied to content.

Recommendations  Remove antiquated browser checks and deliver different sheets.  Consolidate all our main styles into site.css in the App_Themes folder.  All CSS files should be in the App_Themes folder and have a.css extension (not.txt).  Make a decision on what standard colors, fonts, alignment, etc should go into the app.  Remove spacer.gifs, table layouts, and other browser hacks in lieu of proper CSS.  Make a decision on how individual modules should implement their styles.  Make a decision on how the CSS file is to be structured.  Move inline presentation formatting to CSS external sheets.

Resources   This is CSS at its finest   The Official CSS Site   Australian firm, very professional  e/stylesheet_guide e/stylesheet_guide  Where you can CSS and Web Design