Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

Cascading Style Sheets
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.
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.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create 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.
กระบวนวิชา 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.
Tutorial 4: Creating page layout with css
Tutorial 4: Creating page layout with css
Tutorial 6 Creating Fixed-Width Layouts
 CSS Presentation and layout is based on the CSS Box Model.  The CSS Box Model states that every element on a page is a rectangular box.  This includes:
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Tutorial #8 – Creating Data Tables. Tutorial #6 Review – Layouts Two Column Fixed Width, Three Column Fixed Width Class VS. ID Container Universal Selector.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
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.
Tutorial 6 Creating Tables and CSS Layouts. Objectives Session 6.1 – Create a data table to display and organize data – Modify table properties and layout.
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.
Advanced CSS - Page Layout. Advanced CSS  Compound Selectors:  Is a Dreamweaver term, not a CSS term.  Describes more advanced types of selectors such.
Tutorial 4: Using CSS for Page Layout. 2 Objectives Session 4.1 Explore CSS layout Compare types of floating layouts Examine code for CSS layouts View.
ITP 104.  While you can do things like this:  Better to use styles instead:
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Website Layouts Most websites have organized their content in multiple columns (formatted like a magazine or.
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.
 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.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
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.
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.
DIV, Span, CSS.
1 © Netskills Quality Internet Training, University of Newcastle Using Style Sheets in Dreamweaver CS © Netskills, Quality Internet Training, University.
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.
WEB DEVELOPMENT IMMERSIVE BUILDING PAGE LAYOUTS. 2 Box Model Scaling Positioning Boxes Box Aesthetics HTML 5 Semantic Tags CSS Resets TOPICS GENERAL ASSEMBLYWEB.
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.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
CONTROLLING Page layout
Tutorial 4 Creating Page Layouts with CSS
Positioning Objects with CSS and Tables
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
04 – CSS Informatics Department Parahyangan Catholic University.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
Positioning, CSS Layout Ing. Jiří Štěpánek.  Positioning = defining elements placement, size and behavior within a page  Important for creating layout.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
Web Design (17) CSS Box Element (2). ‘Box’ Web Site (1) Insert a navigation bar into the index.html file and create links to ‘index.html’, ‘pageone.html’
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.
Working with Cascading Style Sheets
CSS Layouts: Grouping Elements
Concepts for fluid layout
Creating Page Layouts with CSS
Advanced CSS BIS1523 – Lecture 20.
Cascading Style Sheets (Layout)
Styles and the Box Model
Fixed Positioning.
Web Development & Design Foundations with H T M L 5
Concepts for fluid layout
Presentation transcript:

Tutorial #6 – Creating Fixed Width Layouts

Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can set individual side, all sides, or combo of shortcuts Float Clear Background-image, background-color, background- position, background-repeat, background-attach, background-cover* CSS Precedence (1. User defined, 2. Inline, 3. Embedded 4. External, 5. Browser Defaults) Pathnames Project

Reminders Final Project Purpose and Organization Due Date coming up Due Next Class ( ) No class on for Independence Day Have all Homework up to Tutorial 6 done and linked properly on your Homework Page and Pathnames Project done by

Page Layouts Fixed Width – Content stays the same when the window is resized Liquid – Content adjusts (expands/contracts) when window is resized. Hybrid – Combo of both Recall the box model (format and position the elements) Window resize could be use adjusted or could be changes in resolution

Two Column Fixed Layout Horizontal header at the top ( ) Horizontal navigation bar ( ) Sidebar with links or information ( ) Main Content Area ( ) Horizontal Footer with contact information or general information ( ) Prior to HTML5 all elements would be divided with div tags and different IDs.

Class VS ID Classes In CSS.class In HTML ID In CSS #idname In HTML The id selector is used for a single element on the page Only 1 element can have an ID. Multiple elements can be formatted with classes

HTML 5 added elements for header, footer, nav, aside but did not put a “main’ or content. They did add the section element. We use the section element with and id to format the main content section. Two Column Fixed Layout #main{ background-color: gray; width: 680px; }

Universal Selector CSS selector to select all elements Due to styling precedence and browser defaults trying to setup layouts can sometimes not look correct. This could be due to margin and padding defaults Use the Universal Selector (*) to clear out all values. * { margin: 0; padding: 0; }

Creating the Container Container serves as a large box to put all the elements in. This is also sometimes called a wrapper. Advantages It can determine the width of the page layout Recommended to have a width of 900 to 960 pixels It can be used to center the layout horizontally A border can be added to unify page content Can be used to apply the background (color or image) to contrast the body element Must account for browser’s frame, scroll bars, etc

Creating the Container #container { background-color: purple; width: 930px; border-width: 1px; margin 0 auto; } …

Determine the Content Width Since we set the container width to 930px, we need to make sure no other elements have a width greater than that otherwise the layout will break Take the width of the container, subtract the left/right margins, borders, and padding values from the width. That will give the max width. header { background-color: green; margin: px 0; padding: 10px; width: 910px; /* 930 – 10padding left - 10 padding right */ }

Adding a Navigation bar Use the nav element to define the navigation Since our goal is a 2 column fixed width layout we can mimic the header for the nav width nav { background-color: blue; width: 910px; margin: px 0; padding: 10px; }

Using the aside Element HTML5 element aside is used to mark content that is not the main Can have more than one Should use ID to uniquely identify Use float to position In our example we have 930px container width. The Width of the aside + main content must be <= 930px

Main Section This section will hold the main content of the page Uses element with an ID to identify the main area. There is not a specific element for main. Since our goal is to have a side bar and main content we need to remember that the combined width must be less than our container (930px) Float can be used to position the main section

Main and Aside aside{ background-color: brown; width: 200px; margin: 0 10px 10px 0; padding: 10px; float: left; height: 400px; } #main { background-color: gray; width: 680px; margin: px 0; padding: 10px; float: right; height: 400px; }

Dependent ID Just like classes, IDs can be independent or dependent on an element Since IDs can only be used once on the page the dependent ID would be used to specify one element that the ID will be used on Div#container { background-color:teal; {

Creating Style for the Footer Uses the element In our example the footer is similar to the header for width footer { background-color: red; width: 910px; padding: 10px; clear: both; height: 75px; }

Creating Three Column Layout Very similar to what we have done so far with the two column layout Create a second section or aside area for the 3 rd column Can float left, no float, float right Could also float all three columns the same direction Float right, right, right would be the same effect. Still must make sure the total width is less than the main container

Quiz – Match Up 1..center 2. div#main 3. Nav.links 4. #quotes A. Independent ID B. Independent Class C. Dependent ID D. Dependent Class

The Box-Shadow Property Box-shadow property used to create a 3Dshadow effect Box-shadow: h-shadow v-shadow blur spread inset; H-shadow – Position of the horizontal shadow (Shifts shadow to the right from the right) V-shadow – position of the vertical shadow (shifts shadow down from the top) Blur – The blur distance (optional) Spread – The spread distance (optional) Inset – Sets shadow placement inside rather than outside (optional)

Box-Shadow.logo { box-shadow: 10px 15px 10px; }

Creating Rounded Corners Prior to HTML5 it took 4 images manipulated to create the effect HTML5 adds the border-radius property which specifies the a radius of measurement Works with the shadow propery (shadow rounded aswell) Border-radius for all 4 sides or specify one corner Border-top-left-radius Border-top-right-radius Border-bottom-right-radius Border-bottom-left-radius

Creating Rounded Corners.logo { box-shadow: 10px 15px 10px; border-radius: 20px; }

Figure element When using image for informational purposes it can be wrapped with the element Captions can be added with element Benefits for styling and screen readers DMACC

Layouts in Dreamweaver Page Type: HTML Lots to choose from Preview available

Lab 1. Create the container: Width 930px 2. Create the header, nav, and footer px width, 10px padding, 10px margin on bottom 2. Footer should clear the float 3. Create the side bar 1. float left, 200px wide, padding 10px, margin 10px on right and bottom 4. Create the main section 1. ID main, float right, 680px wide, 10px padding 5. Add shadow and rounded corners to the DMACC Logo within a figure element

Tutorial #7 – Creating Liquid Width Layouts

Liquid Layouts Setup the same as fixed except use % instead of pixels Content adjusts with window resizing Max width 100% should be less than 100% due to some browser rendering aside{ width: 20%; } #main { width: 68%; } footer { width: 90%; }

Tutorial 7 – Liquid Layouts Page 384 advantages of 2 layouts Page 396 Floating columns Min and Max width for to prevent content shifts Min-width: value; Max-width: value;

Using Print Styles You can setup a specific CSS to format you page for printing (on a physical printer) Print Style Change text color to black and background to white Set font size Set font Set elements to not be displayed Set line height to 120% or greater Use #page rule to set the page size and margin

Media Attribute Using the media attribute All (default) – Style for all devices Screen – Only style what is displayed in the browser window Print – Assigns style to document being printed

@page Rule Defines the size of the print { Size: 8.5in 11in; Margin: 0.5in; }

Display Property Can use the display property to hide content Header { display:none; } What CSS Property hides content besides display? How do they act different?

Display vs Visibility Visibility - The visibility property specifies whether or not an element is visible. Keeps spacing. Display does not keep spacing Footer { visibility: hidden; }

Display vs. Visibility Left is display:none, right is Visibility: hidden In this case clearing the footer removed the clear:both