40 likes | 135 Views
Responsive design and final review. Matt Brendzel GA Boston Programs Producer. William Neely CEO, Piecewise.com. Responsive design. Fixed, fluid, elastic. Fixed Container with set width Fluid Use percentages to define widths/sizes
E N D
Responsive design and final review Matt Brendzel GA Boston Programs Producer William Neely CEO, Piecewise.com
Responsive design Fixed, fluid, elastic Fixed • Container with set width Fluid • Use percentages to define widths/sizes • Ex: body{font-size:100%; width:100%;} col1,col2{width:50%; float:left; font-size:150%;} Elastic • Use ems to define sizes, % for width
Responsive design Ems/rems Font-size:100% • Standardizes browser • 1em=16px (standard) Ems vs % Em/% based on inherited font-size http://alistapart.com/articles/howtosizetextincss REM (root em) • Uses font-size set for html element Body{ Font-size:100%; /*hint for non mathies: set font-size:62.5%; to make 1em 10px*/ } *{ font-size:1.5em; } Div{ font-size:1.2em; }
Responsive design Media queries Media queries exercise Busy hands responsive Img technique (use % and height:auto) Word-wrap:break-word @media only screen and • (max-width: xPx) • (min-width: xPx) • (max-device-width:xPx) • (min-device-width:xPx) For iPad • (orientation: portrait) • (orientation: landscape) Separate multiple clauses with “and”