Daveandal.net Cascading Style Sheets 101 “How I learnt to love CSS and found my inner designer”

Slides:



Advertisements
Similar presentations
Introduction to HTML & CSS
Advertisements

Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Today CSS HTML A project.
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Very quick intro HTML and CSS. Sample html A Web Title.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Website Layouts Most websites have organized their content in multiple columns (formatted like a magazine or.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Art 128 Interface Programming 1 In-class Presentation Week 11B.
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.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
HTML. Goals How to use the Komodo editor HTML coding and testing – List and Images – Tables and Links – At least 2 pages and navigation –
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Bayu Priyambadha, S.Kom. for long documents, you can even have links to other locations in that same document  … where ident is a variable for identifying.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheet Basics Pepper. Looking at the HTML See the surrounding tags See head, body, paragraph, header See the ending tags See the list.
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.
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.
Web standards pragmatism Patrick H. Lauke / Web Developers Conference / 12 November 2008 FROM VALIDATION TO THE REAL WORLD.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Copyright © 2013 MyGraphicsLab / Pearson Education STRUCTURE AND HTML TAGS MyGraphicsLab: Adobe Dreamweaver CS6 ACA Certification Preparation for Web Communication.
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
Essentials of HTML Class 4 Instructor: Jeanne Hart
 Remember that HTML is just text  Need to point to pictures  Use the img tag  alt: › screen reader › REQUIRED for this class and to validate.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
Copyright 2007, Information Builders. Slide 1 Understanding Basic HTML Amanda Regan Technical Director June, 2008.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
XHTML and CSS. The Browser The browser is not print!
Professor Waterman Cascading Style Sheets (CSS) is a language that works with HTML documents to define the way content is presented. The presentation.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
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.
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.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
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.
8/13/2003 Designing Without Tables Using CSS by Reshma Kumar and Marina Naito.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
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.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Essential Questions What challenges do mobile devices present to Web designers? What are the basic concepts.
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.
Working with Cascading Style Sheets
Cascading Style Sheets (CSS)
4.01 Cascading Style Sheets
Concepts for fluid layout
Cao Yuewen SEEM4570 Tutorial 03: CSS Cao Yuewen
Cascading Style Sheets (Layout)
Cascading Style Sheets
Styles and the Box Model
Fixed Positioning.
What are Cascading Stylesheets (CSS)?
Web Development & Design Foundations with H T M L 5
Training & Development
Floating and Positioning
Concepts for fluid layout
4.01 Cascading Style Sheets
Presentation transcript:

daveandal.net Cascading Style Sheets 101 “How I learnt to love CSS and found my inner designer”

Agenda Why use CSS? First steps Styling content Styling sites

Obligatory Quote If style sheets or similar information are not added to HTML, the inevitable price will be documents that only look good on a particular browser, at a particular window size with the default fonts, etc Chris Lilley (former chair of CSS Working Group)

What is HTML? HMTL is content   Implied semantics HTML is NOT presentation

What is CSS? CSS is a styling language Presentation is separate from content

What does CSS Enable? Separates style from structure   Cleaner code Cross browser & device layout Increased Accessibility Multiple designs and easy redesign Reduces page size   Reduce cost, Improved performance

The Problems of CSS

What's holding you back? You think CSS is hard Wrong   Simple CSS is easy   Complex CSS can be hard

What we do wrong Markup according to look   Using because is too big   Whitespace added with and   Embedd presentation...

First Steps Clean up your HTML Switch from presentational To semantic My heading Read some important news My heading Read some important news

First Steps Remove deprecated elements and attributes   nges.html#h-A Remove inline styles...

Next Steps Apply styling   Create stylesheet   Add stylesheet rules   Don't overuse classes

Next Steps, with Server Controls Only use server controls when needed Be aware of the markup they generate Use CSS adapters

IDs and Classes # refers to element id. refers to class... #warning { color: #ff0000; }....warning { color: #ff0000; }

Don't overdo classes.menuLink { color:#fcfcfc; text-decoration: none; }

Don't overdo classes – the cure #menu > a { color:#fcfcfc; text-decoration: none; }

Simple CSS Demo Convert non-styled page to a styled page

Adding Stylesheets Use with "modern.css";

Conditional Stylesheets Using conditional comments to avoid hacks Allows cleaner CSS

Images Images are presentation Images can reduce accessibility   Use empty alt attribute Better to use CSS <asp:Image AlternateText="" GenerateEmptyAlternateText="true" />

Images in CSS Welcome to our site #header { background: url(logo.gif) no-repeat left top; padding: 10px; border: 0; }

Data Entry Forms Often use tables Tables should be for tabular content Use CSS layout instead

Forms – Entry Fields Associate labels with entry fields First Name:

Forms - Layout Grouping related content Enter your details:...

Forms - Layout <asp:Label ID="label1" runat="server" AssociatedControlID="FirstName" Text="First Name:" /> div { height: 1.3em; position: relative; } div input, div select { position: absolute; left: 7em; }

Forms Demo

Site Layout Table based designs CSS based designs

Don’t Abandon Proven Design Tables are dead, long live tables   Easy to implement   No CSS knowledge required But   Table based designs can be   Less accessible   Less flexible   Less maintainable

Site Design without Tables CSS 101 Home Contact Obligatory copyright stuff

Site Design without Tables #header { background: url(../images/logo.jpg); background-position: 0 0; background-repeat: no-repeat; height: 72px; } #nav { left: 0; width: 20%; padding: 1em 0; position: absolute; } #content { left: 20%; width: 80%; padding: 1em 0; position: relative; }

Don't catch 'divitus' CSS 101 Home Contact Obligatory copyright stuff

Don't catch 'divitus' CSS 101 Home Contact Obligatory copyright stuff

Don't catch 'divitus' CSS 101 Home Contact Obligatory copyright stuff

Site Design Demo

Summary CSS can be easy Improve development   Reduced maintenance   Improved performance Feel good   Improving the web, one site at a time

Resources Books   Designing with web standards, Jeffrey Zeldman   Transcending CSS, Andy Clarke   Core CSS 2 nd Ed, Keith Schengili-Roberts

Resources Sites   http//:       dex.aspx

Resources Tools   HTML Validator     HTML Tidy     CSS Validator  

Browser Tools IE   IE Developer Toolbar Firefox   CSS Viewer   Edit CSS   Firebug   Web Developer

Me and My Stuff