Web Page Layout. table vs. div table –Pros: supported by all browsers –Cons: bind style to content; hard to maintain div –Pros: easy to maintain –Cons:

Slides:



Advertisements
Similar presentations
CGS 3175: Internet Applications (CSS – Page Layout) Page 1 © Mark Llewellyn CGS 3175: Internet Applications Fall 2008 Cascading Style Sheets – Page Layout.
Advertisements

CSS provides a way to stray away from the traditional methods of using tables to lay out pages. Success with this technique depends on understanding of.
Basic use of columns is to organize a list of navigation links down the left or right side of the page next to a main content area. (Fig. 1) Another common.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Tutorial 6 Creating Fixed-Width Layouts
Murach’s ASP.NET 3.5/C#, C5© 2008, Mike Murach & Associates, Inc.Slide 1.
1 Chapter 12 Layout and Positioning Part I of II.
Web Design HTML Basic Robertus Setiawan Aji Nugroho References: w3schools.com.
ITI 133: HTML5 Desktop and Mobile Level I
Technologies for web publishing Ing. Václav Freylich Lecture 6.
WEB DESIGN Multimedia and Web. Today’s Objectives  Quick review selector types  Layout and positioning.
External style rules for HTML Organization web sites can share a style sheet Layout of pages using positioning Absolute & Relative Positioning Cascading.
1 CSS more details Reasons to use CSS for page layoutReasons to use CSS for page layout Relative and absolute positioningRelative and absolute positioning.
External Style rules for HTML Standardize organization web sites Page Layout using positioning Absolute & Relative Positioning of Elements Cascading Style.
4.01 Cascading Style Sheets
CSS Box Model. What is the CSS Box Model? The “Box Model” is a tool we use to lay out our web pages in a number of individual "boxes" or "containers".
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
Web Development & Design Foundations with XHTML
Basics of Web Design 1 Copyright © 2016 Pearson Education, Inc., Hoboken NJ.
IS1825 Developing Multimedia Applications for Business Lecture 4: CSS Positioning and Flow Rob Gleasure
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
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.
FTS: The Perils and Promise of Computing Cascading Style Sheets (CSS) Gustavus Adolphus College Fall 2012.
Slide 1 of 55 Positioning The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what.
Web Programming Language CSS – Part 2 Dr. Ken Cosh (CSS II)
Part 4 Introduction to CSS. CSS Table Table Borders table, td, th { border:1px solid black; } Firstname Lastname Bader Ali Paul Manuel The example below.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
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.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
آموزش طراحی وب سایت جلسه پنجم– سی اس اس 2 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
Today’s objectives Layouts | floats Measurement units Type properties
Web Development & Design Foundations with XHTML Chapter 6 Key Concepts.
CONTROLLING Page layout
Positioning Elements CHAPTER 3 1 CHARLES WYKE-SMITH: STYLIN’ WITH CSS: A DESIGNER’S GUIDE (3 ND EDITION)
Styles for webpages. Multi-column layout #navcol {position: absolute; top: 5px; left: 5px; width:260px; background-color: black; border:none; z-Index:0}
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
OV Copyright © 2008 Element K Content LLC. All rights reserved. Working with Web Pages  An Introduction to Cascading Style Sheets  Format a Web.
CS134 Web Design & Development Web Page Layout Mehmud Abliz.
Week 5.  Normal document flow  Affecting document flow with float and position properties using CSS  Using these properties to create layouts.
Nesting and Floating. Nesting and Floating Elements To make our page content appear the way we want, and to make the best use of screen space, we can.
Positioning, CSS Layout Ing. Jiří Štěpánek.  Positioning = defining elements placement, size and behavior within a page  Important for creating layout.
Simple Website Layout Tutorial Using HTML 5 and CSS 3 Ref: layout-tutorial-html-5-css-3/
1 Copyright © 2013 Lee, Kim & Park, Life & Power Press 1 를 이용한 레이아웃.
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,
Mimi Opkins.  One of the major benefits of using CSS is that you’re not forced to lay your sites out in tables.  The layout possibilities of CSS give.
CSS Box Model.
Web Development & Design Foundations with XHTML
Google fonts CSS box model
Advanced CSS & CSS3.
Box model.
Creating Layouts Using CSS
CSS Box Model.
DynamicHTML Cascading Style Sheet Internet Technology.
Grids, Floats & Flex Boxes
DynamicHTML Cascading Style Sheet Internet Technology.
How to use the CSS box model for spacing, borders, and backgrounds
Web Design & Development
Web Development & Design Foundations with XHTML
CSS and Class Tools.
Laying out Elements with CSS
Advanced CSS.
CSS Box Model.
CSS Box Model.
Presentation transcript:

Web Page Layout

table vs. div table –Pros: supported by all browsers –Cons: bind style to content; hard to maintain div –Pros: easy to maintain –Cons: not supported by all browsers We recommend – div, reasons: –CSS is to separate structure from content. –Supporting most common/popular browsers are enough. May be it’s time for some people to upgrade their browsers.

Common Layouts Variable width content: –2 columns - left menu –2 columns - right menu –3 columns Centered (fixed width content): –2 columns –3 columns 4 columns (fluid/variable width) Many other …

2 columns - left menu

#Header { margin:50px 0px 10px 0px; padding:17px 0px 0px 20px; border:1px dashed #999; background-color:#eee; } #Content { margin:0px 50px 50px 200px; padding:10px; border:1px dashed #999; background-color: #eee; } #Menu { position:absolute; top:100px; left:20px; width:150px; padding:10px; background-color:#eee; border:1px dashed #999; }

2 columns – centered, static width

body { margin:0px; padding:0px; text-align: center; } #Wrapper { width:700px; margin-right:auto; margin-left:auto; border:1px dashed #999; } #Header { background: #eee; }

2 columns – centered, static width #Menu { float:right; width:200px; background: #eee; } #Content { float:left; width:500px; background: #666; } #Footer { clear: both; background: #eee; }

2 columns - right menu

#Header { margin:50px 0px 10px 0px; padding:17px 0px 0px 20px; border:1px dashed #999; background-color:#eee; } #Content { margin:0px 200px 50px 50px; padding:10px; border:1px dashed #999; background-color: #eee; } #Menu { position:absolute; top:100px; right:20px; width:150px; padding:10px; background-color:#eee; border:1px dashed #999; }

3 columns - flanking menu

.content { position:relative; width:auto; min-width:120px; margin:0px 210px 20px 170px; border:1px solid black; padding:10px; z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */ } #navAlpha { position:absolute; width:128px; top:20px; left:20px; border:1px dashed black; background-color:#eee; padding:10px; z-index:2; }

3 columns - flanking menu #navBeta { position:absolute; width:168px; top:20px; right:20px; border:1px dashed black; background-color:#eee; padding:10px; z-index:1; }

z-index (or stack level) z-index: auto | | inherit –Z-axis positions are particularly relevant when boxes overlap visually. –In addition to their horizontal and vertical positions, boxes lie along a "z-axis" and are formatted one on top of the other. –Boxes with higher z-index stacked on top of the boxes with lower z-index. –Boxes with the z-index are stacked back- to-front according to document tree order.

3 columns – centered, static width

body { text-align:center; margin:0px; padding:0px; font:12px verdana, arial, helvetica, sans-serif; } #frame { width:750px; margin-right:auto; margin-left:auto; margin-top:10px; text-align:left; border:1px dashed #999; background-color: yellow; } #topcontent { background-color: #eee; }

3 columns – centered, static width #centercontent { float:left; width:400px; background-color: green; } #leftcontent { float:left; width:175px; background-color: red; } #rightcontent { float:left; width:175px; background-color: red; } #bottomcontent { background-color:#eee; text-align:center; }

4 columns - variable width

#topcontent { background-color: yellow; } #leftcontent { position: absolute; left:1%; width:20%; top:50px; background:#fff; } #centerleft { position: absolute; left:22%; width:28%; top:50px; background:#fff; }

4 columns - variable width #centerright { position: absolute; left:51%; width:28%; top:50px; background:#fff; } #rightcontent { position: absolute; left:80%; width:19%; top:50px; background:#fff; }