Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
Web Development & Design Foundations with XHTML Chapter 7 Key Concepts.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
Copyright (c) 2009 Prentice-Hall. All rights reserved.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
CGS 3175: Internet Applications (CSS – Page Layout) Page 1 © Mark Llewellyn CGS 3175: Internet Applications Fall 2008 Cascading Style Sheets – Page Layout.
Page Layouts The next step in our development of our web page design is to implement page layouts – In 1996, W3C recommended what we call CSS Level 1 and.
16 HTML Tables and Frames Section 16.1 Create a basic table using HTML Define borders Merge cells Align content in tables Section 16.2 Create a frames-based.
1 CSS more details Reasons to use CSS for page layoutReasons to use CSS for page layout Relative and absolute positioningRelative and absolute positioning.
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
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.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with XHTML
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
Copyright © Terry Felke-Morris CSS Flow & Positioning 1 Copyright © Terry Felke-Morris.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
FTS: The Perils and Promise of Computing Cascading Style Sheets (CSS) Gustavus Adolphus College Fall 2012.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
Cascading Style Sheets (CSS) Part II IT210: Web-based IT.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
CONTROLLING Page layout
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Cascading Styles Sheets Positioning HTML elements.
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
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with XHTML
4.01 Cascading Style Sheets
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
Creating Layouts Using CSS
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5
Web Development & Design Foundations with XHTML
Web Development & Design Foundations with HTML5
4.01 Cascading Style Sheets
Presentation transcript:

Web Development & Design Foundations with XHTML Chapter 6 Key Concepts

2 Learning Outcomes In this chapter, you will learn about: Reasons to use CSS for page layout Relative and absolute positioning The CSS Box Model Configuring basic page layouts using CSS Configuring two column page layouts using CSS Locating CSS page layout resources

3 CSS Page Layout Overview W3C Recommendations for CSS level 2 published in 1998 It took years for reliable browser support of CSS Present Day: It is common practice to design web page layouts with CSS Examples:

4 CSS Page Layout Advantages Greater typography control Style is separate from structure Potentially smaller documents Easier site maintenance Increased page layout control Increased accessibility Ability to define styles for multiple media types Support of the Semantic Web

5 CSS Page Layout Disadvantages There still remain issues with the lack of uniform browser support of CSS If you are already adept at designing page layout using XHTML tables, your productivity will temporarily drop as you learn to configure page layout with CSS.

6 The Box Model Content Text & web page elements in the container Padding Area between the content and the border Border Between the padding and the margin Margin Determines the empty space between the element and adjacent elements

Normal Flow Browser display of elements in the order they are coded in the Web page document

8 Relative Positioning Changes the location of an element in relation to where it would otherwise appear h1 { background-color:#cccccc; padding:5px; color: #000000; } #myContent { position: relative; left:30px; font-family:Arial,sans-serif; }

9 Absolute Positioning Precisely specifies the location of an element in the browser window h1 { background-color:#cccccc; padding:5px; color: #000000; } #content {position: absolute; left:200; top:100; font-family:Arial,sans-serif; width:300; }

Absolute Positioning Example

11 Float Property Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using the float property. h1 { background-color:#cccccc; padding:5px; color: #000000; } p { font-family:Arial,sans-serif; } #yls {float:right; margin: 0 0 5px 5px; border: solid; }

12 Display Property Configures how and if an element is displayed display:none ; The element will not be displayed. display:block ; The element is rendered as a block element -- even if it is actually an inline element, such as a hyperlink. display:inline; The element will be rendered as an inline element – even if it is actually a block element – such as a. You’ll work with the display property in Chapter 7.

13 Z-Index Property Modifies the stacking order of elements on a Web page. The default z-index value is “0". Elements with higher z- index values will appear stacked on top of elements with lower z-index values rendered on the same area of the page.

14 CSS Properties Used with Page Layout & Formatting See Table 6.1 in your text for an alphabetical listing. Also see Appendix C

15 Checkpoint State three reasons to use CSS for page layout on a commercial site being developed today. 2. Describe the difference between relative and absolute positioning. 3. Describe the purpose of the z-index CSS property.

CSS Page Layout Example Except for imagelogo, all elements on this page follow normal flow

17 Two Column Page Layout wrapper contains the two columns – sets default background color Left-column navigation float: left; width:100px; Right-column content margin-left: 100px; floatright (flower photo) float: right;

18 body {margin:0; font-family:Verdana, Arial, sans-serif; } #wrapper { background-color:#e8b9e8; color:#000066; } #leftcolumn { float:left; width:100px; } #rightcolumn { margin-left:100px; background-color:#ffffff; color:#000000; } #logo { background-color:#eeeeee; color: #cc66cc; font-size:x-large; border-bottom: 1px solid #000000; padding:10px; }.content {padding:20px 20px 0 20px; } #floatright {margin:10px; float:right; }.footer {font-size:xx-small; text-align:center; clear:right; padding-bottom:20px; }.navBar{ text-decoration:none; margin: 15px; display:block; } Two Column Page Layout

19 Deciding to Configure a class or id Configure a class: If the style may apply to more than one element on a page Use the. (dot) notation in the style sheet. Use the class attribute in the XHTML. Configure an id: If the style is specific to only one element on a page Use the # notation in the style sheet. Use the id attribute in the XHTML. A class name should be descriptive of the purpose (such as nav, news, footer, and so on) rather than being descriptive of the presentation (such as redText). According to Google’s Web Authoring Statistics Study, the 10 most commonly used class names are footer, menu, title, small, text, content, header, nav, copyright, and button.

20 Choosing a Name for a class A class name should be descriptive of the purpose: such as nav, news, footer, and so on The the 10 most commonly used class names are: footer, menu, title, small, text, content, header, nav, copyright, and button. Source:

21 CSS Debugging Tips Manually check syntax errors Use W3C CSS Validator to check syntax errors Configure temporary background colors Configure temporary borders Use comments to find the unexpected cascade Don’t expect your pages to look exactly the same in all browsers! Be patient!

22 CSS Page Layout Resources For additional study: Large collection of CSS page layouts and links to tutorials Comprehensive list of tutorials and CSS-related sites The web site of Eric Meyer, a leading-edge web developer W3C’s list of CSS resources A “reservoir” of CSS page layouts CSS syntax reference list

23 Summary This chapter introduced you to using Cascading Style Sheets to configure page layouts. Be patient with yourself and plan on reviewing the CSS resources material. It takes a while to grasp this technology.