ITI 133: HTML5 Desktop and Mobile Level I

Slides:



Advertisements
Similar presentations
15 LAYOUT Controlling the position of elements Creating site layouts Designing for different sized screens.
Advertisements

Session 4 Chapter 15 - How to Use jQuery Mobile to Build and Mobile Web Site ITI 134: HTML5 Desktop and Mobile Level II
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
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
Tutorial 4: Creating page layout with css
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Tutorial 6 Creating Fixed-Width Layouts
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
Principles of Web Design 6 th Edition Chapter 10 – Data Tables.
Cascading Style Sheets CSS. CSS Positioning Normal Flow Top -> bottom | left -> right Arranged in the order they appear in the code make room for one.
Cascading Style Sheets CSS. div … Used like a container to group content Gives context to the elements in the grouping Give it a descriptive name with.
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.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
 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.
 Website development process  CSS  Javascript.
 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.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Layout with Styles Castro Chapter 11. Tables vs. CSS You can produce “liquid layouts” (layouts that stretch as the browser is resized) using tables or.
CSS3   
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
Introduction to CSS Layout
CONTROLLING Page layout
Extra-simplified.  Only truly happen when the CSS and HTML are defined as separate files (external style sheet) Introduction The main idea of CSS is.
CSS - Quiz #3 Lecture Code:
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
Week 5.  Normal document flow  Affecting document flow with float and position properties using CSS  Using these properties to create layouts.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Cascading Styles Sheets Positioning HTML elements.
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,
CSS Layouts: Positioning and Navbars
HTML5 Level II Session V Chapter 8 - How to Use Responsive Web Design (RWD)
Webpage layout using CSS
Cascading Style Sheets (Layout)
CS3220 Web and Internet Programming Page Layout with CSS
HTML5 Level II Session II
ITI 133 HTML5 Desktop and Mobile Level I
Session I Chapter 10 - How to Work with Tables
ITI 133 HTML5 Desktop and Mobile Level I
HTML5 Level I Session III
Styles and the Box Model
HTML5 Level I Session II Chapter 3 - How to Use HTML to Structure a Web Page
HTML5 Session III Chapter 5 - How to Use the CSS Box Model for Spacing, Borders, and Backgrounds Chapter 6 - How to use CSS for page.
MORE Cascading Style Sheets (The Positioning Model)
HTML5 Level I Session III
HTML5 Level I Session III
Session VI Chapter 8 - How to Use Responsive Web Design (RWD)
HTML Level II (CyberAdvantage)
Chapter 8 - How to Use Responsive Web Design (RWD)
Web Development & Design Foundations with H T M L 5
Floating and Positioning
CS3220 Web and Internet Programming Page Layout with CSS
ITI 134: HTML5 Desktop and Mobile Level II
CSc 337 Lecture 5: Grid layout.
Session IV Chapter 15 - How Work with Fonts and Printing
ITI 133: HTML5 Desktop and Mobile Level I
Positioning Boxes Using CSS
Presentation transcript:

ITI 133: HTML5 Desktop and Mobile Level I Session 3 - Chapter 6 How to Use the CSS for Page Layout www.profburnett.com

Copyright © Carl M. Burnett Class Outline HTML5 2-Column Web Page with Fixed-Width Columns 2-Column Web Page with Liquid Widths 3-Column Web Page with Fixed-Width Columns How to Use CSS to Create Multiple Columns How to Use Position Elements 8/1/2014 Copyright © Carl M. Burnett

HTML5 for a 2 Column Layout <body> <header><h1>Header</h1></header> <section><h1>Section</h1></section> <aside><h1>Aside</h1></aside> <footer><h1>Footer</h1></footer> </body> 8/1/2014 Copyright © Carl M. Burnett

A 2-Column Web Page with Fixed-Width Columns Header Section Aside Footer 8/1/2014 Copyright © Carl M. Burnett

CSS For 2-column web page with fixed-width columns * { margin: 0; padding: 0; } body { width: 962px; background-color: white; margin: 15px auto; border: 1px solid black; } h1 { padding: 10px; } header { border-bottom: 2px solid #ef9c00; } section { height: 400px; width: 600px; float: left; border-right: 2px solid #ef9c00; float: left; } aside { width: 360px; float: right; } footer { clear: both; border-top: 2px solid #ef9c00; } 8/1/2014 Copyright © Carl M. Burnett

A 2-Column Web Page with Liquid Widths Header Section Aside Footer 8/1/2014 Copyright © Carl M. Burnett

CSS For 2-Column Web Page with Liquid Widths body { width: 90%; background-color: white; margin: 15px auto; border: 1px solid black; } section { width: 66%; height: 400px; border-right: 2px solid #ef9c00; float: left; } aside { width: 33%; float: right; } 8/1/2014 Copyright © Carl M. Burnett

CSS for 2-Column Web Page with Fixed and Liquid Widths body { width: 90%; background-color: white; margin: 15px auto; border: 1px solid black; } section { float: left; } aside { height: 400px; width: 360px; border-left: 2px solid #ef9c00; float: right; } 8/1/2014 Copyright © Carl M. Burnett

HTML For 3-Column Web Page with Fixed-Width Columns <body> <header><h1>Header</h1></header> <aside id="sidebarA"><h1>Sidebar A</h1></aside> <section><h1>Section</h1></section> <aside id="sidebarB"><h1>Sidebar B</h1></aside> <footer><h1>Footer</h1></footer> </body> 8/1/2014 Copyright © Carl M. Burnett

A 3-Column Web Page with Fixed-Width Columns Header Sidebar A Section Sidebar B Footer 8/1/2014 Copyright © Carl M. Burnett

CSS for 3-Column Web Page with Fixed-Width Columns body { width: 964px; background-color: white; margin: 15px auto; border: 1px solid black; } #sidebarA { width: 180px; height: 400px; float: left; border-right: 2px solid #ef9c00; } section { width: 600px; float: left; } #sidebarB { float: right; border-left: 2px solid #ef9c00; } 8/1/2014 Copyright © Carl M. Burnett

How to Use CSS3 to Create Multiple Columns Browser Support CSS3 Properties for Creating Multiple Columns column-count column-gap column-rule column-span 8/1/2014 Copyright © Carl M. Burnett

How to Use CSS3 to Create Multiple Columns article { -moz-column-count: 3; -webkit-column-count: 3; column-count: 3; } 8/1/2014 Copyright © Carl M. Burnett

How to Use CSS3 to Create Multiple Columns article { -moz-column-count: 3; -webkit-column-count: 3; column-count: 3; -moz-column-gap: 25px; -webkit-column-gap: 25px; column-count-gap: 25px; -moz-column-rule: 2px solid black; -webkit-column-rule: 2px solid black; column-rule: 2px solid black; } Example 8/1/2014 Copyright © Carl M. Burnett

How to Use Position Elements Property for Positional Elements Property Description position Keyword (See table below) top, bottom, left, right Absolute or Fixed z-index Integer ( Set to absolute relative or fixed) Possible Values for Position Property Property Description static Placed in normal flow (Default) absolute Removed from flow. Positioned relative to closest block fixed Positioned absolute to browser window relative Positioned relative to the normal flow 8/1/2014 Copyright © Carl M. Burnett

HTML for Web Page with Absolute Positioning <body> <section> <h1>Our speakers for 2011-2012</h1> <ul> <li>October 19, 2011: <a href="speakers/toobin.html"> Jeffrey Toobin</a></li> <li>November 16, 2011: <a href="speakers/sorkin.html"> Andrew Ross Sorkin</a></li> <li>January 18, 2012: <a href="speakers/chua.html"> Amy Chua</a></li> </ul> <p>Please contact us for tickets.</p> </section> <aside> <p><a href="raffle.html">Enter to win a free ticket!</a></p> </aside> </body> 8/1/2014 Copyright © Carl M. Burnett

CSS for Web Page with Absolute Positioning p { margin: 0;} body { width: 500px; margin: 0 25px 20px; border: 1px solid black; position: relative; } aside { width: 80px; padding: 1em; position: absolute; right: 30px; top: 50px; } Example 8/1/2014 Copyright © Carl M. Burnett

HTML for the Positioned Elements <section> <h1><i>Murach’s JavaScript and DOM Scripting</i></h1> <h2>Section 1<span class="title">Introduction to JavaScript programming</span></h2> <h3>Chapter 1<span class="title">Introduction to web development and JavaScript</span><span class="number">3</span></h3> <h3>Chapter 2<span class="title">How to code a JavaScript application</span> <span class="number">43</span></h3> ... <h2>Section 2<span class="title">JavaScript essentials</span></h2> <h3>Chapter 6<span class="title">How to get input and display output</span> <span class="number">223</span></h3> </section> 8/1/2014 Copyright © Carl M. Burnett

CSS for the Positioned Elements section h2 { margin: .6em 0 0; position: relative; } section h3 { font-weight: normal; margin: .3em 0 0; .title { position: absolute; left: 90px; } .number { right: 0; } Example 8/1/2014 Copyright © Carl M. Burnett

HTML for Overlapping Elements <!DOCTYPE html> <html> <head> <style> img { position:absolute; left:0px; top:0px; z-index:-1; } </style> </head> <body> <h1>This is a heading</h1> <img src=“mcc.gif" width="100" height="140" /> <p>Because the image has a z-index of -1, it will be placed behind the text.</p> </body> </html> 8/1/2014 Copyright © Carl M. Burnett

CSS For Overlapping Elements img { position:absolute; left:0px; top:0px; z-index:-1; } Example 8/1/2014 Copyright © Carl M. Burnett

Copyright © Carl M. Burnett Student Exercise 3 Complete Exercise 6-1, 6-2 and 6-3 on page 227 using Dreamweaver. Download link for files for Exercise 6-1 on website. Upload your HTML pages and CSS files to the live site to preview. 8/1/2014 Copyright © Carl M. Burnett

Class Review HTML5 How to Use CSS to Create Multiple Columns 2-Column Web Page with Fixed-Width Columns 2-Column Web Page with Liquid Widths 3-Column Web Page with Fixed-Width Columns How to Use CSS to Create Multiple Columns How to Use Position Elements Next – Session 4 Chapter 7 - How to Work with Links and Lists 8/1/2014 Copyright © Carl M. Burnett