Kick It Up a Notch: Enhance your web page with Cascading Style Sheets Kathy Fletcher Manager, Training & Publications Support Services Office of Information.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
กระบวนวิชา 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.
Chapter 6 Web Typography
Week 7 Web Typography. 2 Understanding Type Design Principles.
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
SM5312 week 6: basic CSS syntax1 An Introduction to Cascading Style Sheets Basic CSS Syntax Nick Foxall.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
Computing Concepts: CSS. Aims  To understand the uses of css  To understand the different types of css  To be able to create a css file  To be able.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
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.
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 Example
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
CSS Dvijesh Bhatt.
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.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
CSS Cascading Style Sheets By Garrett Garman. CSS Why use Style Sheets? Separates Appearance and Structure Modularity Quick and Easy changes Flexibility.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
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.
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
Cascading Style Sheets Class 1, Lecture 1 Rachel A Ober
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
Cascading Style Sheets CSS by Pavlovic Nenad by. 2Cascading Style Sheets Presentation Contents What are CSS? What are CSS? History of CSS History of CSS.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
CO1552 – Web Application Development Cascading Style Sheets.
INTRODUCTION TO CSS. OBJECTIVES: D EFINE WHAT CSS IS. K NOW THE HISTORY OF CSS. K NOW THE REASON WHY CSS IS USED. CSS SYNTAX. CSS ID AND CLASS.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
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.
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
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.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
CSS with XHTML Please use speaker notes for additional information!
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.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
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.
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.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
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.
CSS Cascading Style Sheets *referenced from
Basic Webpage Design Cascading Style Sheet (CSS).
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.
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.
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

Kick It Up a Notch: Enhance your web page with Cascading Style Sheets Kathy Fletcher Manager, Training & Publications Support Services Office of Information Technology West Virginia University

Why use Style Sheets?  separate structure from appearance  create consistent appearance  ease of maintenance  increase accessibility  apply additional effects  reduce use of non-standard tags  reduce web page file size

Ensure Consistent Appearance & Ease of Maintenance  Create one style sheet  Use link tag to use for several web pages  Make changes in one file

Increase Accessibility  User can override your style sheet  You can create different style sheets for alternative devices

Apply Additional Effects  Add hover effect to links  Remove underlines on links  Add horizontal rule to headings  Use instead of a table for a border  Control paragraph, line, letter spacing  Use instead of tables for layout

Replace Non-standard Tags Some tags and attributes have been deprecated in HTML 4.0 Strict

Reduce Web Page File Size  Every keystroke counts!  Smaller files load more quickly  Save disk space  Example webreg.html Original: 27.2K Embedded Style Sheet: 26.2K External Style Sheet: 25.6K

Where do you put styles?  In-line - add to HTML tag  Embedded style sheets  External style sheets

In-line  Similar to adding attributes to html tags  Disadvantages decreased accessibility increased file size harder to update

Embedded style sheets  Put rules between style tags  Put in head section  Add html comment tags  Use when single document has unique style

External style sheets  Save rules in external file  Advantages ease of maintenance use less disk space increase accessibility

Imported external style url(myway.css); You may specify url(readable.css) url(listening.css) aural;

Three types of style sheets  Author: designed to fit the site you are currently visiting  User: your own style sheet, created to fulfill your own needs  User agent: default style sheets inside the browser you're using The style sheet rule with greatest weight will take precedence

Cascade Order: which style sheet rule wins?  author > user > browser  !important: user > author > browser  more specific > more general  order specified: later > earlier rules

Hierarchy of HTML tags … … …

Structure of a Rule  name_of_tag { property: value(s) ; …} H1 { font-family: Times, serif; }  Multiple properties on one rule: H1 {color: black; font-weight: bold;}  Group tags: H1, H2, H3 { font-family: Times, serif; }  Contextual selector: H1 EM {color: maroon; font-weight: bold; font-style: italic; }

Class selector & attribute To create rules that can be applied to a variety of html tags.bar {color: maroon; font-size: smaller; background-color: yellow;} … text … link

Apply Additional Effects  Add hover effect to links  Remove underlines on links  Add horizontal rule to headings  Control paragraph, line, letter spacing  Use instead of a table for a border  Use instead of tables for layout

h1 { font-size: 2em; vertical-align: text-bottom; line-height: 1.25em; margin-right: 5%; font-family: "Arial Black", Verdana, sans-serif; letter-spacing: 0.5em; color: blue; background-color: silver} h2 { border-style: solid none none none; border-width: medium; border-color: #808080; margin-top: 1.5em; margin-bottom:.5em; font-size: 1.75em; text-transform: capitalize; } ul { margin-top:.1em; list-style: square} li { margin-bottom:.25em;} a { text-decoration: none; } a:hover { text-decoration: underline; color: #800000; background-color: #ffcc00;} Additional effects

!Important  User can mark items in their style own sheets as important  !important rules over-ride author’s settings p {font-size: 18pt !important}

Browser Support  Older (before CSS): NN3, Lynx  Limited: WebTV, EmacSpeak  Broken: IE3, IE4, NN4  Compliant: Mozilla and Netscape 6 Opera 5 and 6 recent versions of Internet Explorer

CSS and Accessibility  Use good HTML: instead of  Make sure page is readable without any style sheet enabled CSS Techniques for WCAG 1.0

Validation  Validate your HTML validator.w3.org validator.w3.org  Validate your CSS jigsaw.w3.org/css-validator/ jigsaw.w3.org/css-validator/  Check for web accessibility bobby.watchfire.com bobby.watchfire.com

Additional Testing  Different browsers: Internet Explorer 5 Mozilla or Netscape 6 Netscape 4  Different platforms: PC / Mac  Different browser window sizes  Different resolutions

What to look for  Access to information  Functionality  Aesthetics

Create alternate style sheets for different media  screen  print  aural – EmacSpeak (unix)  handheld  tv, tty, braille, embossed, projected classmat/css/etdlist3.html

<!-- body { font-family: Arial, Geneva, sans-serif; background-color: white; color: black;} p { width: 550px; } h2 { text-align: center; background-color: #FFF8E1; color: #800000; font-size: 1em; margin-bottom:.18em;} h3 { font-size: 1em; display: run-in; } ul { list-style-type: square; width: 520px;} em { font-weight: bold; background-color: white; color: maroon; font-style: normal; }.smalltext { font-size: 40% }.bar { background-color: #ffcc00; color: #000080; font-size: x-small; width: auto;} -->

<!-- body {font-family: Times, serif; color: black; background-color: white;} p, li {font-size: 12pt;} h1 { font-size: 18pt; font-weight: bold;} h2 { font-size: 14pt; font-weight: bold;} h3 { font-size: 12pt; font-weight: bold;} ul { list-style-type: square; page-break-inside: avoid;} em {font-style: italic; font-weight: bold; }.bar {display: none;}.break {page-break-after: always;}.smalltext { font-size: 75% } -->

<!-- body { voice-family: Paul, male; speak-punctuation: none} h1 { cue-before: url("ding.wav") } p { pause-after: 10ms; } strong { volume: loud; richness: 60Hz ; pause-before: 20ms; pause-after: 10ms ;} em { pause-before: 50ms; stress: 60Hz ; } -->

<!-- body {background: white; color: black} a:link {color: blue} a:visited {color: #990066} h1, h3 {color: #888888} p {margin: 0} img {max-width: 100%} h2 {background: #005A9C; color: white; padding: 0.3em; border-top: 1em solid #F73; margin-top: 0} div.back {border-top: 0.49em solid #CC0; margin: 1em 0} div.banner {margin: 0.5em 0; padding: 0.3em; background: black} div.banner p {display: inline; font-weight: bold} div.banner a:before {content: " · "} -->

References  1. Cascading Style Sheets: The Definitive Guide 2. Eric Meyer on CSS  Teach Yourself CSS in 24 Hours, Kynn Bartlett  W3C:  WaSP:  CSS FAQ: developer.irt.org/script/css.htmdeveloper.irt.org/script/css.htm  