SlideShare a Scribd company logo
1 of 35
Web Design Principles
5th
Edition
Chapter Seven
Designing Page Layouts
Objectives
When you complete this chapter, you will be able to:
• Understand the normal flow of elements
• Use the division element to create content
containers
• Create floating layouts
• Build a flexible page layout
• Build a fixed page layout
2Web Design Principles 5th
Ed.
Understanding the Normal Flow
of Elements
Understanding the Normal Flow
• The normal flow determines the sequence of
element display
• Boxes are laid out vertically one after the other,
beginning at the top of the containing
• Each box horizontally fills the browser window
Web Design Principles 5th
Ed. 4
5Web Design Principles 5th
Ed.
Understanding the Normal Flow
• In the normal flow for inline elements, boxes are
laid out horizontally beginning at the top left of the
containing block
• The inline boxes comprise the lines of text within,
for example, a <p> element
• When you float an element, you take it out of the
normal flow
• Check the results frequently as you are designing
your layout using floats
6Web Design Principles 5th
Ed.
7Web Design Principles 5th
Ed.
Using the Division Element to
Create Content Containers
• The <div> element is your primary tool for creating
content sections
• Use the box properties to create divisions in the
shape you need
• You can create columns and control the space
between them
• Use a container division, often called a wrapper, to
contain a page layout
8Web Design Principles 5th
Ed.
9Web Design Principles 5th
Ed.
10Web Design Principles 5th
Ed.
Creating Floating Layouts
• The float property lets you build columnar layouts
• You can align content elements to either the right or
left side of the browser window
• A typical Web page design can contain both
floating and non-floating elements
• Remember to always use a width property for
floating elements
11Web Design Principles 5th
Ed.
Web Design Principles 5th
Ed. 12
Creating Floating Layouts
• Building floating layouts requires that you choose a
method for containing the floating elements
• You will often see that the floating elements extend
beyond their containing elements, which will result
in a “broken” layout
13Web Design Principles 5th
Ed.
Web Design Principles 5th
Ed. 14
Solution 1: Using a
Normal Flow Element
• If you have multiple columns, at least one needs to
be non-floating (in the normal flow)
• The non-floating element must be positioned with
the margin properties
15Web Design Principles 5th
Ed.
16Web Design Principles 5th
Ed.
Solution 2: Using the Clear Property
• Use a non-floating footer element (in the normal
flow), with the clear property set to both
17Web Design Principles 5th
Ed.
18Web Design Principles 5th
Ed.
Floating Elements within Floats
• Floating elements give you a wide variety of
options for building interesting page layouts
• If you are floating an element within another
element, the order of the elements is important
19Web Design Principles 5th
Ed.
Web Design Principles 5th
Ed. 20
Web Design Principles 5th
Ed. 21
Web Design Principles 5th
Ed. 22
Fixing Column Drops
• Column drops occur when the total width of the
columnar elements in a page layout exceeds the
width of their containing element
23Web Design Principles 5th
Ed.
24Web Design Principles 5th
Ed.
Clearing Problem Floats
• Floats occasionally do not appear exactly where
you want them to appear
• The clear property can solve this problem
25Web Design Principles 5th
Ed.
Web Design Principles 5th
Ed. 26
Building a Flexible Page Layout
• Flexible layouts adapt to the size of the browser
window
• With a flexible layout, your content has to adapt
and look good at a wide range of layout sizes
27Web Design Principles 5th
Ed.
28Web Design Principles 5th
Ed.
29Web Design Principles 5th
Ed.
Controlling Flexible Layout Width
• You can control the compression and expansion of
your content in a flexible layout by setting minimum
and maximum widths
div.wrapper {
width: 100%;
min-width: 750px;
max-width: 1220px;
}
30Web Design Principles 5th
Ed.
Building a Fixed Page Layout
• Fixed layouts remain constant despite the resizing
of the browser in different screen resolutions and
monitor sizes
• Many designers prefer fixed layouts because they
have more control over the finished design
• Fixed layouts are normally contained by a wrapper
element that controls the page width and centers
the page in the browser window
31Web Design Principles 5th
Ed.
32Web Design Principles 5th
Ed.
Controlling Fixed Layout Centering
• A wrapper division lets you automatically center the
layout in the browser
• This is a great solution for wide-screen monitors
• Automatic centering is a simple use of the margin
property
#wrapper {
width: 960px;
margin-left: auto;
margin-right: auto;
border: thin solid black;
background-color: #ffc;
}
33Web Design Principles 5th
Ed.
34Web Design Principles 5th
Ed.
Summary
• The normal flow dictates the way in which elements
normally are displayed in the browser window
• When you remove an element from the normal
flow, you may see unexpected behavior from other
elements
• Remember to always use a width property for
floating elements
• Remember to avoid using the height property
• For fixed layouts, content elements are usually
contained with a wrapper element that sets the
width for the page layout
35Web Design Principles 5th
Ed.

More Related Content

Viewers also liked

A CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSS
A CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSSA CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSS
A CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSSJimena Kerszenblat
 
Drugi rok Zwinnej Łodzi
Drugi rok Zwinnej ŁodziDrugi rok Zwinnej Łodzi
Drugi rok Zwinnej ŁodziRadoslaw Lont
 
Road Trip Summer 2016
Road Trip Summer 2016Road Trip Summer 2016
Road Trip Summer 2016bobpearlman
 
From Students to Learners: New Learning Environments for 21st Century Learners
From Students to Learners: New Learning Environments for 21st Century LearnersFrom Students to Learners: New Learning Environments for 21st Century Learners
From Students to Learners: New Learning Environments for 21st Century Learnersbobpearlman
 
What does 21st Century Learning look like?
What does 21st Century Learning look like?What does 21st Century Learning look like?
What does 21st Century Learning look like?bobpearlman
 
We Make Makers! The new Innovation Labs, Makerspaces, and Learning Commons
We Make Makers! The new Innovation Labs, Makerspaces, and Learning CommonsWe Make Makers! The new Innovation Labs, Makerspaces, and Learning Commons
We Make Makers! The new Innovation Labs, Makerspaces, and Learning Commonsbobpearlman
 
Basesdedatos curso
Basesdedatos cursoBasesdedatos curso
Basesdedatos cursoPacodgo
 
Calling the Roll: Study Circles for Better Schools
Calling the Roll: Study Circles for Better SchoolsCalling the Roll: Study Circles for Better Schools
Calling the Roll: Study Circles for Better SchoolsNatalie Aflalo
 
El grito de independencia
El grito de independenciaEl grito de independencia
El grito de independenciaMariana Delgado
 
Табір "Веселка"
Табір "Веселка"Табір "Веселка"
Табір "Веселка"Julja Chernenko
 
rahul resume (1)(1)
rahul resume (1)(1)rahul resume (1)(1)
rahul resume (1)(1)RAHUL KUMAR
 

Viewers also liked (17)

Ppt ch08
Ppt ch08Ppt ch08
Ppt ch08
 
A CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSS
A CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSSA CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSS
A CALL FOR ACTION TO STRENGTHEN HEALTHCARE FOR HEARING LOSS
 
Drugi rok Zwinnej Łodzi
Drugi rok Zwinnej ŁodziDrugi rok Zwinnej Łodzi
Drugi rok Zwinnej Łodzi
 
Road Trip Summer 2016
Road Trip Summer 2016Road Trip Summer 2016
Road Trip Summer 2016
 
Ppt ch09
Ppt ch09Ppt ch09
Ppt ch09
 
From Students to Learners: New Learning Environments for 21st Century Learners
From Students to Learners: New Learning Environments for 21st Century LearnersFrom Students to Learners: New Learning Environments for 21st Century Learners
From Students to Learners: New Learning Environments for 21st Century Learners
 
What does 21st Century Learning look like?
What does 21st Century Learning look like?What does 21st Century Learning look like?
What does 21st Century Learning look like?
 
Ahn i lab
Ahn i labAhn i lab
Ahn i lab
 
We Make Makers! The new Innovation Labs, Makerspaces, and Learning Commons
We Make Makers! The new Innovation Labs, Makerspaces, and Learning CommonsWe Make Makers! The new Innovation Labs, Makerspaces, and Learning Commons
We Make Makers! The new Innovation Labs, Makerspaces, and Learning Commons
 
Mule introduction
Mule introductionMule introduction
Mule introduction
 
Basesdedatos curso
Basesdedatos cursoBasesdedatos curso
Basesdedatos curso
 
Calling the Roll: Study Circles for Better Schools
Calling the Roll: Study Circles for Better SchoolsCalling the Roll: Study Circles for Better Schools
Calling the Roll: Study Circles for Better Schools
 
El grito de independencia
El grito de independenciaEl grito de independencia
El grito de independencia
 
Dfd info
Dfd infoDfd info
Dfd info
 
Табір "Веселка"
Табір "Веселка"Табір "Веселка"
Табір "Веселка"
 
Researching genre
Researching genreResearching genre
Researching genre
 
rahul resume (1)(1)
rahul resume (1)(1)rahul resume (1)(1)
rahul resume (1)(1)
 

Similar to Ppt ch07

9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.pptSimonChirambira
 
how to make your own website - Website design
how to make your own website - Website designhow to make your own website - Website design
how to make your own website - Website designVishnuSharmaDigital
 
9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.pptSimonChirambira
 
Chapter05-Presentation.pptx
Chapter05-Presentation.pptxChapter05-Presentation.pptx
Chapter05-Presentation.pptxssuserf3db48
 
Basics of expression blend4
Basics of expression blend4Basics of expression blend4
Basics of expression blend4Samson Tennela
 
Cross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazineCross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazinePrabhakaran Mani
 
Ifi7174 lesson4
Ifi7174 lesson4Ifi7174 lesson4
Ifi7174 lesson4Sónia
 
Creating a Website with WordPress.org
Creating a Website with WordPress.orgCreating a Website with WordPress.org
Creating a Website with WordPress.orgEileen Lonergan
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelonahernanibf
 
Advanced CSS.pptx
Advanced CSS.pptxAdvanced CSS.pptx
Advanced CSS.pptxDiyonaVas
 
Approaches to CSS Layout
Approaches to CSS LayoutApproaches to CSS Layout
Approaches to CSS LayoutNicole Ryan
 
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...Mediacurrent
 
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveDesign Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveInductive Automation
 
Fluid lay out arcweb smac
Fluid lay out arcweb smacFluid lay out arcweb smac
Fluid lay out arcweb smacSmith Johnson
 

Similar to Ppt ch07 (20)

9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt
 
-
--
-
 
Ppt ch02
Ppt ch02Ppt ch02
Ppt ch02
 
Ppt ch02
Ppt ch02Ppt ch02
Ppt ch02
 
Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
Ppt ch12
Ppt ch12Ppt ch12
Ppt ch12
 
how to make your own website - Website design
how to make your own website - Website designhow to make your own website - Website design
how to make your own website - Website design
 
9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt
 
Chapter05-Presentation.pptx
Chapter05-Presentation.pptxChapter05-Presentation.pptx
Chapter05-Presentation.pptx
 
Basics of expression blend4
Basics of expression blend4Basics of expression blend4
Basics of expression blend4
 
Cross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazineCross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazine
 
Ifi7174 lesson4
Ifi7174 lesson4Ifi7174 lesson4
Ifi7174 lesson4
 
Creating a Website with WordPress.org
Creating a Website with WordPress.orgCreating a Website with WordPress.org
Creating a Website with WordPress.org
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
 
Ppt ch03
Ppt ch03Ppt ch03
Ppt ch03
 
Advanced CSS.pptx
Advanced CSS.pptxAdvanced CSS.pptx
Advanced CSS.pptx
 
Approaches to CSS Layout
Approaches to CSS LayoutApproaches to CSS Layout
Approaches to CSS Layout
 
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
 
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition PerspectiveDesign Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
Design Like a Pro: Building Mobile-Responsive HMIs in Ignition Perspective
 
Fluid lay out arcweb smac
Fluid lay out arcweb smacFluid lay out arcweb smac
Fluid lay out arcweb smac
 

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

Ppt ch07

  • 1. Web Design Principles 5th Edition Chapter Seven Designing Page Layouts
  • 2. Objectives When you complete this chapter, you will be able to: • Understand the normal flow of elements • Use the division element to create content containers • Create floating layouts • Build a flexible page layout • Build a fixed page layout 2Web Design Principles 5th Ed.
  • 3. Understanding the Normal Flow of Elements
  • 4. Understanding the Normal Flow • The normal flow determines the sequence of element display • Boxes are laid out vertically one after the other, beginning at the top of the containing • Each box horizontally fills the browser window Web Design Principles 5th Ed. 4
  • 6. Understanding the Normal Flow • In the normal flow for inline elements, boxes are laid out horizontally beginning at the top left of the containing block • The inline boxes comprise the lines of text within, for example, a <p> element • When you float an element, you take it out of the normal flow • Check the results frequently as you are designing your layout using floats 6Web Design Principles 5th Ed.
  • 8. Using the Division Element to Create Content Containers • The <div> element is your primary tool for creating content sections • Use the box properties to create divisions in the shape you need • You can create columns and control the space between them • Use a container division, often called a wrapper, to contain a page layout 8Web Design Principles 5th Ed.
  • 11. Creating Floating Layouts • The float property lets you build columnar layouts • You can align content elements to either the right or left side of the browser window • A typical Web page design can contain both floating and non-floating elements • Remember to always use a width property for floating elements 11Web Design Principles 5th Ed.
  • 12. Web Design Principles 5th Ed. 12
  • 13. Creating Floating Layouts • Building floating layouts requires that you choose a method for containing the floating elements • You will often see that the floating elements extend beyond their containing elements, which will result in a “broken” layout 13Web Design Principles 5th Ed.
  • 14. Web Design Principles 5th Ed. 14
  • 15. Solution 1: Using a Normal Flow Element • If you have multiple columns, at least one needs to be non-floating (in the normal flow) • The non-floating element must be positioned with the margin properties 15Web Design Principles 5th Ed.
  • 17. Solution 2: Using the Clear Property • Use a non-floating footer element (in the normal flow), with the clear property set to both 17Web Design Principles 5th Ed.
  • 19. Floating Elements within Floats • Floating elements give you a wide variety of options for building interesting page layouts • If you are floating an element within another element, the order of the elements is important 19Web Design Principles 5th Ed.
  • 20. Web Design Principles 5th Ed. 20
  • 21. Web Design Principles 5th Ed. 21
  • 22. Web Design Principles 5th Ed. 22
  • 23. Fixing Column Drops • Column drops occur when the total width of the columnar elements in a page layout exceeds the width of their containing element 23Web Design Principles 5th Ed.
  • 25. Clearing Problem Floats • Floats occasionally do not appear exactly where you want them to appear • The clear property can solve this problem 25Web Design Principles 5th Ed.
  • 26. Web Design Principles 5th Ed. 26
  • 27. Building a Flexible Page Layout • Flexible layouts adapt to the size of the browser window • With a flexible layout, your content has to adapt and look good at a wide range of layout sizes 27Web Design Principles 5th Ed.
  • 30. Controlling Flexible Layout Width • You can control the compression and expansion of your content in a flexible layout by setting minimum and maximum widths div.wrapper { width: 100%; min-width: 750px; max-width: 1220px; } 30Web Design Principles 5th Ed.
  • 31. Building a Fixed Page Layout • Fixed layouts remain constant despite the resizing of the browser in different screen resolutions and monitor sizes • Many designers prefer fixed layouts because they have more control over the finished design • Fixed layouts are normally contained by a wrapper element that controls the page width and centers the page in the browser window 31Web Design Principles 5th Ed.
  • 33. Controlling Fixed Layout Centering • A wrapper division lets you automatically center the layout in the browser • This is a great solution for wide-screen monitors • Automatic centering is a simple use of the margin property #wrapper { width: 960px; margin-left: auto; margin-right: auto; border: thin solid black; background-color: #ffc; } 33Web Design Principles 5th Ed.
  • 35. Summary • The normal flow dictates the way in which elements normally are displayed in the browser window • When you remove an element from the normal flow, you may see unexpected behavior from other elements • Remember to always use a width property for floating elements • Remember to avoid using the height property • For fixed layouts, content elements are usually contained with a wrapper element that sets the width for the page layout 35Web Design Principles 5th Ed.