La Layou out an and Gr Grids No screens Prof. Lydia Chilton - - PowerPoint PPT Presentation

la layou out an and gr grids
SMART_READER_LITE
LIVE PREVIEW

La Layou out an and Gr Grids No screens Prof. Lydia Chilton - - PowerPoint PPT Presentation

La Layou out an and Gr Grids No screens Prof. Lydia Chilton COMS 4170 24 January 2018 COMS 4170 Goal 1 Build websites that suit the needs and abilities of users The main goal of many websites is to display information users need. Layout


slide-1
SLIDE 1

La Layou

  • ut an

and Gr Grids

  • Prof. Lydia Chilton

COMS 4170 24 January 2018 No screens

slide-2
SLIDE 2

COMS 4170 Goal 1

Build websites that suit the needs and abilities of users

The main goal of many websites is to display information users need.

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6

Layout in HTML

How to construct the layout of information in HTML and CSS

slide-7
SLIDE 7

Today’s goal:

Remake this in informatio ion la layout in HTML and CSS

slide-8
SLIDE 8

“I finished coding up my website…” “It just doesn’t work yet!”

slide-9
SLIDE 9

It Iter erativ tive Style of Programming

<html> <body> Hello world! </body> </html>

What’s the most basic thing I can do to make necessary progress towards my goal?

Does it look ok?

Goal Iteration

slide-10
SLIDE 10

Step 0. Make a html page, connect some CSS

slide-11
SLIDE 11

List 20 things we could we do first.

slide-12
SLIDE 12

Make a container div

slide-13
SLIDE 13

What next?

slide-14
SLIDE 14

Container div has realistic width.

slide-15
SLIDE 15

What next?

slide-16
SLIDE 16

Blue facebook header

slide-17
SLIDE 17

What next?

slide-18
SLIDE 18

Blue facebook header

slide-19
SLIDE 19

What next?

slide-20
SLIDE 20

Add the first post

slide-21
SLIDE 21

What next?

slide-22
SLIDE 22

Add internal structure to the first post

slide-23
SLIDE 23

By default, DIV elements will flow down the page. display: block To get them to flow across the page, you must set display: inline-block

slide-24
SLIDE 24

What next?

slide-25
SLIDE 25

Add padding on the top post

slide-26
SLIDE 26

What next?

slide-27
SLIDE 27

Replies

slide-28
SLIDE 28

What next?

slide-29
SLIDE 29

Reply substructure: image and text

slide-30
SLIDE 30

What next?

slide-31
SLIDE 31

Reply Container positioning

slide-32
SLIDE 32

What next?

slide-33
SLIDE 33

Reply Class background-color

slide-34
SLIDE 34

Reduce Reply Text Width

slide-35
SLIDE 35

What next? Am I done?

slide-36
SLIDE 36

Reply Text is longer

slide-37
SLIDE 37

Reply Text height fixed

slide-38
SLIDE 38

Remove borders

slide-39
SLIDE 39

NA NAIL ILED D IT IT!

slide-40
SLIDE 40

After layout… what next?

slide-41
SLIDE 41

It Iter erativ tive Style of Programming

<html> <body> Hello world! </body> </html>

What’s the most basic thing I can do to make substantial progress towards my goal?

Does it look ok?

slide-42
SLIDE 42

Iterative Style of Programming helped me recover from errors one at a time (as I created them)

Error 1: display inline-block Error 3: Reply div height Error 2: reply div padding

slide-43
SLIDE 43

Grids

Currently the dominant way to layout information

slide-44
SLIDE 44

Many sites use grids to layout the major sections of information.

slide-45
SLIDE 45
slide-46
SLIDE 46
slide-47
SLIDE 47
slide-48
SLIDE 48

Before: Symmetric Layout Now: Grids Asymmetric Layout

slide-49
SLIDE 49

The Bauhaus School of Design

slide-50
SLIDE 50

Jan Tschichold: inspired by clean designs of the Bauhaus school

slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54

Basic Architecture of a grid: * The grid has columns

slide-55
SLIDE 55

Basic Architecture of a grid: * The grid has columns * Rows lay out information vertically. * Within each row, divs can span multiple columns

slide-56
SLIDE 56

Basic Architecture of a grid:

  • The grid has columns
  • Rows lay out information

vertically.

  • Within each row, divs can

span multiple columns

  • Next grids of 12 columns

within a grid.

slide-57
SLIDE 57

Implementing Grids on the Web: Twitter Bootstrap

slide-58
SLIDE 58

Add Bootstrap to your HTML

CSS & JS in <head> tag, before your own CSS

slide-59
SLIDE 59

Bo Bootstrap gri

  • rid. How many columns?
slide-60
SLIDE 60

Example

<div class=“container"> <div class="row"> <div class=“col col-md md-3”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3”> <img src="./hci-square.png" class="img img-responsive"> </div> </div> </div>

slide-61
SLIDE 61
slide-62
SLIDE 62

Note: you can omit the number for even distribution.

<div class=“container"> <div class="row"> <div class=“col col”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col”> <img src="./hci-square.png" class="img img-responsive"> </div> </div> </div>

slide-63
SLIDE 63

Example 2

<div class=“container"> <div class="row"> <div class=“col-md-2”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col-md-2”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col-md-4”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col-md-4”> <img src="./hci-square.png" class="img img-responsive"> </div> </div> </div>

slide-64
SLIDE 64
slide-65
SLIDE 65

How would you create this?

slide-66
SLIDE 66

A nested row

<div class="row"> <div class="col-md-4"> <img src="./hci-square.png" class="img img-responsive"> </div> <div class="col-md-4"> <div class="row"> <div class="row"> <div class="col <div class="col-md md-3"> 3"> <p>Hamlet</p> <p>Hamlet</p> </div> </div> <div class="col <div class="col-md md-9"> 9"> <p>Tomorrow and tomorrow...</p> <p>Tomorrow and tomorrow...</p> </div> </div> </div> </div> <div class="row"> <div class="col-md-3"> <p>Hamlet</p> </div> ...

slide-67
SLIDE 67

Responsive Design

slide-68
SLIDE 68

4 Device sizes

/* Extra small devices Extra small devices (less than 768px) */ @media (max-width: 768px) { #logo { color: yellow; } } /* Small devices Small devices (768px and up) */ @media (min-width: 768px) { #logo { color: red; } } /* Medium devices Medium devices (992px and up) */ @media (min-width: 992px) { #logo { color: blue; } } /* Large devices Large devices (1200px and up) */ @media (min-width: 1200px) { #logo { color: green; } } Phones Tablets Laptops Large desktops

slide-69
SLIDE 69

What will this do?

<div class="row"> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> </div>

slide-70
SLIDE 70

What will this do on a phone?

<div class="row"> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> <div class=“col col-md md-3 col 3 col-xs xs-6”> <img src="./hci-square.png" class="img img-responsive"> </div> </div>

slide-71
SLIDE 71

class=“col-md-3”

Two examples at xs-screen width

class=“col-md-3 col-xs-6”

slide-72
SLIDE 72

In summary…

slide-73
SLIDE 73

It Iter erativ tive Style of Programming

<html> <body> Hello world! </body> </html>

What’s the most basic thing I can do to make substantial progress towards my goal?

Does it look ok?

Goal Iteration

slide-74
SLIDE 74

Gr Grid ids are a modern layout architecture that help in indic icate im importan ance ce through: grouping, size, and location

slide-75
SLIDE 75

Announcements

  • Assignment 1 due tonight @ 11:59
  • If you are on the waitlist, email me your UNI now (by 5:45) and I will add you

to Courseworks as a non-registered students

  • chilton@cs.columbia.edu
  • Check that I have added you by 6pm.
  • People who do not turn in Assignment 1 will be dropped
  • People who turn in Assignment 1 will be added based on priority