Unit I Applying Advanced Styling CSS. CSS3 can style many aspects that in the past required integration of images New features are not supported by all.

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

CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Chapter 6 More CSS Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
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.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Tutorial 4 Formatting Text. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Create a spread heading Indent text Change the line spacing.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
 Using Microsoft Expression Web you can: › Create Web pages and Web sites › Set what you site will look like as you design it › Add text, images, multimedia.
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.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
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)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTION TO HTML5 Styling with CSS3. Round Border Corners  You can modify any element that supports the border property and render rounded borders.
Ins & Outs of. CSS3 is Modular Can we use it now?
WEEK 3 Lecture 2 CSS TEXT AND FONT PROPERTY Copyright © Corporate Health and Consultancy Services Limited Web Developmen t 15.WD.1 Mildred Fakoya.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
Tutorial 8 Enhancing a Web Site with Advanced CSS
COMP213 – Web Interface Design
Adobe Dreamweaver CS3 Revealed CHAPTER THREE: WORKING WITH TEXT AND IMAGES.
HTML, CSS, and XML Tutorial 8 Enhancing a Web Site with Advanced CSS.
Today’s Agenda Advanced CSS Techniques Floating Z-index Centering Sliding Doors Fluid Layouts CSS3 Advanced CSS Lab Mini Project #2.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 14: Enhancements and Effects with CSS3.
Tutorial 3 Adding and Formatting Text with CSS Styles.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
Neal Stublen New Element Styling  html5shiv.js provided support in older IE browsers for new sectioning elements aside, header,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 7: CSS Building Blocks.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
INTRODUCING CSS What CSS does How CSS works Rules, properties, and values.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
Tutorial 3 Designing a Web Page with CSS
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
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.
Web Design (17) CSS Box Element (2). ‘Box’ Web Site (1) Insert a navigation bar into the index.html file and create links to ‘index.html’, ‘pageone.html’
Laying out Elements with CSS
Creating Visual Effects
Web Development & Design Foundations with HTML5 8th Edition
Implementing Responsive Design UNIT I.
Formatting Text with CSS
CSS Layouts CH 13.
Chapter 5 Introduction to Cascading Style Sheets (CSS): Part 2
Tutorial 4 Topic: CSS 3.0 Li Xu
Creating Page Layouts with CSS
Advanced CSS BIS1523 – Lecture 20.
Creating Visual Effects and Animation
CSS3 Cascading Style Sheet
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Chapter 6 More CSS Basics Key Concepts
FOREGROUND COLOR h1 { color: DarkCyan;} h2 { color: #ee4e80;} p { color: rgb(100, 100, 90);} The three traditional ways to specify colors: Color name.
Cascading Style Sheets
CSS – Properties & Values
Web Development & Design Foundations with HTML5 8th Edition
4 Visual Elements and Graphics.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Box model, spacing, borders, backgrounds
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
CSS Style Sheets: Intro
Cascading Style Sheets Color and Font Properties
Basics of Web Design Chapter 6 More CSS Basics Key Concepts
Web Development & Design Foundations with H T M L 5
SEEM4570 Tutorial 3: CSS + CSS3.0
Presentation transcript:

Unit I Applying Advanced Styling CSS

CSS3 can style many aspects that in the past required integration of images New features are not supported by all browsers. Should try to make Web site usable for users with the least-featured browser.

Two sides to a coin Progressive enhancement Graceful degradation It is a matter of direction.

Graceful degradation: ensuring that when site is viewed in browsers that don’t support advanced features, Web page elements should still be displayed in a usable way.

Graceful degradation: ”The practice of building your web functionality so that it provides a certain level of user experience in more modern browsers, but it will also degrade gracefully to a lower level of user experience in older browsers. This lower level is not as nice to use for your site visitors, but it does still provide them with the basic functionality that they came to your site to use; things do not break for them.” ww3.org

Graceful degradation o Appearance and usability of Web site don’t depend on advanced features o Example: specifying alternative text for an image, in case the image cannot be displayed

Progressive enhancement: additional features are used as enhancements only for browsers that can render them o Main content and capabilities available for least-featured browser o Advanced features not crucial to the layout of the Web site

Progressive enhancement enables us to establish a solid baseline of cross-browser support and then enhance the design with advanced CSS features for supportive browsers.

Graceful degradation starts from the status quo of complexity and tries to fix for the lesser experience whereas progressive enhancement starts from a very basic, working example and allows for constant extension for future environments. Degrading gracefully means looking back whereas enhancing progressively means looking forward whilst keeping your feet on firm ground.

Shims or patches: Scripts written specifically to bridge the gap between browsers with reduced feature sets and more fully featured browsers o Available for use by anyone free of charge o Some address a single issue o Some tools package shims in a library of scripts Examples: Modernizr, PIE

Pseudo-element: selectors that enable you to isolate a portion of a larger element for styling o Preceded by colon (:) in older browsers or by double colon (::) in newer ones Double colon distinguishes pseudo- element from pseudo-class A pseudo-class filters existing elements. a:link means all s that are :link. A pseudo-element is a new fake element. div::after means non-existing elements after s.

Drop cap: First letter is enlarged and drops below the first line of text Can be created using :first-letter Must format surrounding text to flow around – use the float property

:first-line pseudo-element applied to paragraph

:before and :after pseudo-elements: allow you to insert content into Web page using style rules o Typically used for repeated text or pictures o Must specify value for the content property Can be text or path to an image before-and-after-pseudo-elements-in-practice

:before pseudo-element code and result

What is the difference between opacity and transparency? Opacity is just the opposite of transparency. If something is 100% opaque, then it's 0% transparent. If it's 75% transparent, then it's 25% opaque.

Opacity Color can be specified in hexadecimal, rgb, and hsl – hue saturation light. Alpha channel: fourth color value representing the opacity o Works for rgb and hsl, known as rgba and hsla o Receives decimal between 0 (fully opaque) and 1 (fully transparent). difference-explained /

Opacity – Graceful degradation o Many browsers do not support the rgba property. o Using the concept of graceful degradation - use this along with rgb

rgba code and resulting partially transparent element RGB RGBA

Creating rounded corners is possible using the CSS3 border-radius property

In past, required overlay of image files simulating the rounded edge

border-radius property Receives value in pixels Larger value results in deeper curves Can use individual property for each corner Requires –moz and –webkit prefixes to work with some browsers

Code for rounded footer corners and resulting element

border-radius: 1em; border-radius-topright: 2em; border-radius-topleft: 2em; border-radius: 2em 0; border-radius: 3em 1em; border-radius: 1em; border-radius-topright: 2em; border-radius-topleft: 2em; border-radius: 2em 0; border-radius: 3em 1em;

Text shadow: creates the appearance of a shadow on a surface behind the text o In past, required using image manipulation software and linking to resulting graphic In CSS3, use text-shadow property o Takes four values: horizontal offset, vertical offset, blur, and shadow color

Values for the text shadow property and resulting graphic text-shadow: 2px 3px 2px #000; copy-and-paste/

Box shadow: creates the appearance of a shadow on an entire unit of page content. o Takes four values: horizontal offset, vertical offset, blur, and shadow color o Has –webkit and –moz variants Examples of both text and box shadow

Examples

Code for box-shadow

Modernizr: free script library for enabling alternative code in order to support graceful degradation o Linked to a Web page and tests each user’s browser to detect supported properties o Based on results, generates set of CSS classes, which can be used by designer to write alternative code and make sure that only the suitable code is rendered

Code incorporating Modernizr script

So HTML5 and CSS3 are not that confusing when you have good teachers.

But wait there’s 2 more.