Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.
-
Upload
norma-wood -
Category
Documents
-
view
264 -
download
1
Transcript of Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.
![Page 1: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/1.jpg)
Principles of Web Design6th Edition
Chapter 7 – Page Layouts
![Page 2: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/2.jpg)
2
Objectives
• 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
![Page 3: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/3.jpg)
3
Understanding the Normal Flow of Elements
![Page 4: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/4.jpg)
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 box
• Each box horizontally fills the browser window
![Page 5: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/5.jpg)
5
![Page 6: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/6.jpg)
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
![Page 7: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/7.jpg)
7
Floating an 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
![Page 8: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/8.jpg)
8
![Page 9: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/9.jpg)
9
Creating Content Containers
![Page 10: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/10.jpg)
10
Creating Content Containers
• Use the sectioning elements and occasionally <div> elements to create content sections
![Page 11: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/11.jpg)
11
![Page 12: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/12.jpg)
12
![Page 13: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/13.jpg)
13
Choosing the Correct Content Element
• The <div> element has no special meaning; use it only as a container style purposes, as in a page wrapper
• <section> is a thematic section of a document with a heading
• <article> is a reusable section of content• Be consistent when using these elements
![Page 14: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/14.jpg)
14
Creating Floating Layouts
![Page 15: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/15.jpg)
15
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
![Page 16: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/16.jpg)
16
![Page 17: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/17.jpg)
17
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
![Page 18: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/18.jpg)
18
![Page 19: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/19.jpg)
19
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
![Page 20: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/20.jpg)
20
![Page 21: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/21.jpg)
21
Solution 2: Using the Clear Property
• Use a non-floating footer element (in the normal flow), with the clear property set to both
![Page 22: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/22.jpg)
22
![Page 23: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/23.jpg)
23
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
![Page 24: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/24.jpg)
24
![Page 25: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/25.jpg)
25
![Page 26: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/26.jpg)
26
![Page 27: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/27.jpg)
27
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
![Page 28: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/28.jpg)
28
![Page 29: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/29.jpg)
29
Clearing Problem Floats
• Floats occasionally do not appear exactly where you want them to appear
• The clear property can solve this problem
![Page 30: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/30.jpg)
30
![Page 31: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/31.jpg)
31
Building a Flexible Page Layout
![Page 32: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/32.jpg)
32
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
• Flexible layouts are the basis for responsive layouts used for mobile devices
![Page 33: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/33.jpg)
33
![Page 34: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/34.jpg)
34
![Page 35: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/35.jpg)
35
Controlling Flexible Layout Width
• You can control the compression and expansion of your content in a flexible layout by setting minimum and maximum widthsdiv.wrapper {width: 100%;min-width: 750px;max-width: 1220px;}
![Page 36: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/36.jpg)
36
Building a Fixed Page Layout
![Page 37: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/37.jpg)
37
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
![Page 38: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/38.jpg)
38
![Page 39: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/39.jpg)
39
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;}
![Page 40: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/40.jpg)
40
![Page 41: Principles of Web Design 6 th Edition Chapter 7 – Page Layouts.](https://reader033.fdocuments.us/reader033/viewer/2022061600/56649e2a5503460f94b17dde/html5/thumbnails/41.jpg)
41
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