ITP 104.  While you can do things like this:  Better to use styles instead:

Slides:



Advertisements
Similar presentations
The Web Wizards Guide to HTML Chapter Six Tables.
Advertisements

Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
Chapter 3 – Web Design Tables & Page Layout
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.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
Today’s objectives Site performance Padding, Margins, Borders
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.
Tutorial 6 Creating Fixed-Width Layouts
Creating a Web Page with Tables. Objectives Create a text table with preformatted text Create the basic structure of a graphical table Organize table.
XP Creating Web Pages with HTML Using Tables. XP Objectives Create a text table Create a table using the,, and tags Create table headers and captions.
Using HTML Tables.
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.
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
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".
CHAPTER 11 Tables. How Are Tables Used Data Display  Very tidy and very useful Better Text Alignment  Putting text in tables allows you to format indents.
The Characteristics of CSS
Basic Responsive Design Techniques. Let’s take a look at this basic layout. It has a header and two columns of text, in a box that is centered on the.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
IDs versus Classes Naming Your Tags for Maximum Functionality.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
WRT235: Writing in Electronic Environments CSS Classes, IDs, divs.
10/4/2015Tables1 Spring, 2008 Modified by Linda Kenney 4/2/08.
 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.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
 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.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
WRA HTML & CSS – BUILDING WEBPAGES. TODAY’S AGENDA Review: external stylesheets Review: transforming a list Intro: the object Intro: the.
CIS234A Lecture 8 Instructor Greg D’Andrea. Review Text Table contains only text, evenly spaced on the Web page in rows and columns uses only standard.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
CONTROLLING Page layout
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Block-Level Elements.
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.
CSS Box Model. What is the Box Model? Each XHTML element appearing on our page takes up a "box" or "container" of space. Each box size is affected not.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 5.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
Cascading Style Sheets for layout
CSS.
Laying out Elements with CSS
CSS Box Model.
CSS Box Model.
CSS Box Model.
The Box Model in CSS Web Design – Sec 4-8
4.01 Cascading Style Sheets
Nesting and Floating.
CSS Layouts: Grouping Elements
Nesting and Floating.
Advanced CSS BIS1523 – Lecture 20.
Cascading Style Sheets for layout
Cascading Style Sheets (Layout)
The Box Model in CSS Web Design – Sec 4-8
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Styles and the Box Model
CSS Box Model.
Floating and Positioning
CSS Box Model.
Nesting and Floating.
Laying out Elements with CSS
4.01 Cascading Style Sheets
CSS Box Model.
CSS Box Model.
Web Programming and Design
Presentation transcript:

ITP 104

 While you can do things like this:  Better to use styles instead:

 You can add styles like  margin  padding This will create a indenting and spacing around the element  Can use the float property to move an element to the side, and let others ‘wrap’ around it

 If you use the float property keep in mind the following:  If all the elements have the same float value (i.e. float: left), they will stack up horizontally side by side in the order they were declared  This is true for most elements

 By default, text and images laid out on a page go the width of the screen browser.  the default page is a large, single column that goes the width of the browser.  The next step in controlling web page layouts is to use "div" tags to create "boxes" that do NOT go the width of the screen.

 If you put an image in the middle of a paragraph of text, and give that image a float value, that the text will "wrap" or go around the image  If we store text in a "box" we can actually float that box in the middle of a paragraph, and the outer text will "wrap" around the "box" of text

 You create "boxes" (of text, images, or both) using the tag  It is similar to the aragraph tag, except that it is regularly used to create regions that are NOT the whole width (100%)  We usually create s we generally give them SET widths.

 Let’s take a look at the following: Box 1 Box 2 Box 1

 Based on the previous example:  even though each box is not very wide, they render on different lines  If we set them to have float values, then they lay out side-by-side similar to how images with float values stack together.

Box 1 Box 2 Box 1

 The DIV tag can be used to create "boxes" in a layout.  Unlike the Paragraph tag, we CAN put divs (boxes) inside divs.  A DIV tag runs the entire width of its container.  i.e. divs have a default style of width:100%  If it is inside another div (box), then by default it goes all the way across (fills out) that box  If it is inside the page, then it by default goes all the way across the page.

 Key div layout style properties:  width: how wide will the box be ▪ i.e. width:400px ▪ i.e. width:50%  float: for all but the outermost container, you probably need to have a float orientation (left or right) ▪ NOTE: for DIVs float will NOT work unless you ALSO have set a width to the box.

 Key div layout style properties:  id: it is not readily obvious why yet, but for now just get in the habit of giving each div a UNIQUE ID name. ▪ Some good structural names are "outercontainer", "header", "footer", "nav" and "maincontent". ▪ You can of course also make up custom names like "movie1" or "actor2”.  margin: is the item "indented" or otherwise have a margin around the OUTSIDE of it? ▪ The property margin: will set a margin around all four sides of the box. ▪ Or you can set just a single side such as margin-left: 20px  which would put a 20 pixel margin on the left side of the box. ▪ You can also use a special setting to make a box be "centered" within its container (most often used to center a layout on a page) by setting margin: auto

 Key div layout style properties:  padding: where margin sets space OUTSIDE of a box, the style property padding creates spacing INSIDE the box (between the edge of the box and its internal contents. ▪ Like margin setting just padding will create padding on all four sides inside the box ▪ or you can set an individual side such as padding-top.  border: the border around the edge of a box. ▪ attribute looks like border: solid 2px red ▪ which means a solid (line) border around the item, that is 2 pixels wide (the border) and is the color red ▪ We will revisit borders later

 Before you start laying out a page, it is useful to first draw some sketches and have an idea of what layout you want to create.  It is MUCH harder to lay out web pages "on the fly" without having first sketched and figured out the overall structure of the "boxes" of content.

 Some people also find it useful to have borders around all boxes (div) when they first start building the page.  To put borders/outlines on ALL boxes (divs) on a page put the code below in the HEAD of your document: div { border: solid 1px black }

 First, decide the overall width dimensions of your page and create an "outer container" box for all of the elements.  Think of this as setting the "width" of the main layout of your page. ▪ If you wanted the whole web page to be 800 pixel across, then you would create an "outer" div (box) that would have a style setting of "width:800px” ▪ then build your main page inside that space.  An example of this might be Main page here.

 Second, figured out a background color or images for that main page container.  Do you want the area outside that "layout box" to have a background color or image? ▪ If so put some background style instructions into the body tag (which the "outercontainer" div is INSIDE).

 Lastly, plan out the main interior of the layout space.  Do you want an inverted L layout?  Does your page have a distinct header and footer?  Will your page have more than one column in its main space?  Is there a navigation, and if so should it be a distinct column of be wrapped by the main content area?

 Some general design considerations for most web page layouts: 1. Will the web page have a fixed width or dynamically scale to the browser? 2. Will the page have a header and/or footer? 3. Will the page have an overall navigation (generally yes). Will it be Left, Right or Top aligned? Is it a fully separated column or will it "float" within other content? 4. Outside of the navigation, will the main page have multiple columns or one main column? 5. What kind of background colors and images will weave throughout the page?