Web Standards XHTML and CSS. Today’s Show ► Discuss web standards ► XHTML ► Layout Without Tables ► CSS ► Why Web Standards?

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Advertisements

Slice and Dice: From PSD Image to XHTML+CSS Svetlin Nakov Telerik Corporation
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Cascading Style Sheets
Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.
CSS Digital Media: Communication and design 2007.
Today CSS HTML A project.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
Introduction to CSS. What is CSS? A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it’s style. Use your (X)HTML.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Introduction to CSS.
Very quick intro HTML and CSS. Sample html A Web Title.
Cascading Style Sheets (CSS): Pixel-Level Control with HTML Ease
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.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
CSS cont. October 5, Unit 4. Padding We can add borders around the elements of our pages To increase the space between the content and the border, use.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
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 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Diliev.com & pLOVEdiv.com  DIliev.com.
“Cascading Style Sheets” for styling WWW information DSC340 Mike Pangburn.
กระบวนวิชา 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.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Unit 20 - Client Side Customisation of Web Pages
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
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.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
Today’s objectives  Presentational | Inline | Block | Validate  CSS | Rules | Declarations.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Web Design I Spring 2009 Kevin Cole Gallaudet University
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Working with Cascading Style Sheets
CS3220 Web and Internet Programming CSS Basics
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Software Engineering for Internet Applications
CS3220 Web and Internet Programming CSS Basics
CS3220 Web and Internet Programming CSS Basics
Session IV Chapter 15 - How Work with Fonts and Printing
Introduction to Cascading Style Sheets (CSS)
Presentation transcript:

Web Standards XHTML and CSS

Today’s Show ► Discuss web standards ► XHTML ► Layout Without Tables ► CSS ► Why Web Standards?

Web Standards ► What are “web standards”? ► Web Standards consist of these W3C recommendations  XHTML 1.0 or Higher  CSS Level 1 and CSS Level 2  DOM Level 1 and DOM Level 2  ECMAScript 262 (The Language formerly known as JavaScript

XHTML? ► XHTML is the “new” version of HTML.  It’s more strict and is an extension of XML  It has its own specifications just like HTML ► XHTML Strict ► XHTML Transitional ► XHTML Frameset

Converting to XHTML ► Declare the DOCTYPE  Strict vs Transitional vs Frameset ► Tag and attributes in lower case ► Attributes must have quoted values ► All tags must have an end tag ( ) ► Nest tags correctly ► Validate the page (

Layout Without Tables Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.”

Layout Without Tables ► Use the tag  Separate your page sections into regions  A is an invisible container for content ► Use Cascading Style Sheets to position your regions ► Separate your display information from your XHTML (No fonts or colors or tables for layout.)

Content Versus Display ► Separating display from content can be tricky  Photos are essentially content, so they can be included in the XHTML  Backgrounds are not content, and neither are colors or fonts, so they should go into the style sheet  BOLD and ITALICS emphasise the content and are often considered part of the content ► Don’t make a style just to bold words. Use ► Don’t make a style just to bold words. Use

Layout Without Tables (Continued) ► Separate your page into important regions  Banner area (Title, banner graphic)  Menu or navigation  Content ► Columns? Sidebar?  Footer ► DO NOT WORRY ABOUT POSITIONING YET!  You’re not doing layout in XHTML!!!

Layout Without Tables (Continued) ► Once your structure is defined, start thinking about the “skins” of the page ► The style sheet is your skin  You can use more than one “skin” for your page.  Because your “look and feel” is separated from your content, changing your design is easy  PDAs, phones, and even printers can have their own style sheets.

IDs and Classes ► Placing IDs as attributes of your elements identifies them as unique. You can use the IDs in your ECMAScript or your style sheet to manipulate the element. ► Classes are applied to elements in order to group the elements  Not unique, but similar ► Assign IDs to the “regions” of your page (layout) ► Assign CLASSES to sub-regions of your page (look and feel)

XHTML Code <head> <title>Company.Com</title>

XHTML Code <body>

XHTML – IMPORTANT STEP This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrad e your browser ? This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrad e your browser ?</p></div> ► We’ll hide this from the newer browsers later!

XHTML Code Company.Com Company.Com </div> <ul> News News Products Products Support Support Contact Us Contact Us </div>

XHTML Code Announcements Announcements This is where my announcements are going </div></div></div> News News Main content will go here </div></div></div>

XHTML Code Copyright © 2004 Company.Com Copyright © 2004 Company.Com </div></body></html>

Our page so far ► Not very pretty, but it is very concise and will work well for old browsers and screen readers. ► Some devices can’t read the styles and will only see this. That’s okay though because they can still read the content and navigate the site.  Instant “text-only” version!

Round 2: CSS Style sheets for a skinnable website: 1. Layout.CSS – simple structure 2. Style.css – colors and fonts (optional) 3. Printer Friendly CSS

That’s A Lot of CSS! ► This structure will  Make old browsers play along  Keeps the layout separate from the colors  Makes it easy to adjust fonts  Makes it really easy to have a “printer friendly version” without doing a lot of additional work.

The “Cascading” Part ► Styles are “Cascading” meaning that they can be redefined several times, either adding to the style’s properties or overriding the properties.  A.box style can have a width defined in one styleshee and a color defined in another.  A.box style can have a width defined in one styleshee and have its width redefined in another style

The Cascading Part (Continued) ► The style that is displayed to the user is the last style applied for that media type.box{background-color:#ffffff;}.box{background-color:#000000;} This would result in a black background

Stacking styles This p {color:#ffffff;} td {color:#ffffff; } td {color:#ffffff; } h1 {color:#ffffff; } h1 {color:#ffffff; } could be simplified to this: p, td, h1 {color:#ffffff; } Keeping your style small and compact will reduce download times for your users!

Selector Types ► ID  #banner ► # sign is used to identify an ID selector in the stylesheet only ► ► ► CLASS .box ► Period (.) is used to identify a class selector in the stylesheet only ► ►

Selector Types ► Redefined Elements  body ► No # or. means that you are going to redefine the characteristics of this element. ► Good for removing that annoying line break left when using the tag.

Using Style to Affect a Region ► #main.content a{ color:#ffffff; } ► All anchor tags within a region defined as class “contents” within a region defined as id “main” ► This ensures that only the elements in a specific section will be modified Link Link <div>

Layout.css body { TEXT-ALIGN: center TEXT-ALIGN: center} #page { display:block; display:block; margin:0px auto; margin:0px auto; VERTICAL-ALIGN: middle; VERTICAL-ALIGN: middle; WIDTH: 800px; WIDTH: 800px; TEXT-ALIGN: left; TEXT-ALIGN: left;}

CSS #webStandardsAlert{display:none;}

Layout.css #banner { display:block;clear:both; WIDTH: 800px; PADDING:0px;}

Layout.css #navigation { DISPLAY: block; clear:both;float:left; MARGIN-TOP: 5px; MARGIN-bottom: 5px; WIDTH: 800px; }

Layout.css #navigation ul { DISPLAY: block; float:left; list-style: none; MARGIN:0px 0px 0px 0px; padding: 0; }

Layout.css #navigation li { DISPLAY: block; DISPLAY: block; float:left; float:left; VERTICAL-ALIGN: middle; TEXT-ALIGN: center; width:98px; width:98px;margin-right:2px;} #navigation li a { DISPLAY: block; }

Layout.css #sidebar { clear:both; MARGIN-TOP: 5px; DISPLAY: block; FLOAT: left; WIDTH: 195px; MARGIN-RIGHT: 5px; }

Layout.css #main { margin-right: -2px; MARGIN-top: 5px; MARGIN-bottom: 5px; DISPLAY: block; float:right; WIDTH: 590px; }

Layout.css.box{display:block;width:100%; MARGIN-BOTTOM: 10px; clear:both;}

Layout.css.box.title { PADDING: 2px; }.box.content { PADDING: 2px; width:100% }

Layout.css #footer{display:block;clear:both; margin-top: 10px; width: 800px; padding: 2px; }

Style.css body { FONT-SIZE: 10pt; FONT-SIZE: 10pt; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #8B8B8B; BACKGROUND-COLOR: #8B8B8B;}

Style.css #banner { BORDER: 1px solid #333333; } #banner #textbanner{ color:#ffffff;} #banner #graphicbanner{ display:none;}

Style.css #navigation { FONT-WEIGHT: bold; FONT-SIZE: 8pt; COLOR: #ffffff; }

Style.css #navigation li a { FONT-WEIGHT: bold; COLOR: #FFFFFF; BACKGROUND-COLOR: #333333; TEXT-ALIGN: center; TEXT-DECORATION: none; border: 1px solid #ffffff; } #navigation ul li a:hover { COLOR: #cccccc; BACKGROUND-COLOR: #666666; }

Style.css.box{ BORDER: 1px solid #333333; BACKGROUND-COLOR: #A5A5A5; }.box.title { FONT-WEIGHT: bold; COLOR: white; BACKGROUND-COLOR: #333333; }

Style.css a { COLOR: #FFFFFF; TEXT-DECORATION: none } a:hover { COLOR: #666666; }

Style.css #footer{ TEXT-ALIGN: center; border: 1px solid #333333; background-color: #A5A5A5; }

Why Are We Doing This? ► Separating layout from content  Makes pages more accessible ► Text-only ► PDA ► Printer-friendly  Makes download times smaller ► Large bandwidth reduction because CSS is cached ► We can now use more graphics

Print.css ► Coming in a later version of this presentation. Please keep checking back.

Why? ► Interoperability  Standards-based browsers show the same thing on all platforms ► Easy design changes  We can make design changes much faster! ►

Resources ► ► / / / ► ► ► ► ► ► ► ex.html ex.html ex.html

Questions? ► at ► Visit web at  Slides will be posted.