SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
CSS Layout

Lim Borey
Phnom	
  Penh	
  .	
  Sunday	
  3rd	
  February	
  2013	
  




WebDesignMeetup
                                                                    @limborey

                                                              www.limborey.com
Content           WebDesignMeetup



 •  Box Model
 •  Positioning
    –  Relative
    –  Absolute
    –  Fixed
 •  Grid System
Box Model                            WebDesignMeetup




                                      Padding	
  



  Margin	
  
                                       Content	
  

    Border	
  


                 #myBox {
                     margin: 10px;
                     padding: 5px;
                     width: 70px;
                 }
Box Model   WebDesignMeetup
Positioning                                WebDesignMeetup



 •  2 types of virtual formatting elements
   –  Block-level element: div, p, h1, …
   –  Inline element: span, strong, …


 •  3 basic positioning schemes
   –  Relative
   –  Absolute
   –  Fixed
Positioning: Relative                     WebDesignMeetup



 •  If you relatively position an element, it will
    stay exactly where it is.
Positioning: Absolute                  WebDesignMeetup



 •  absolute positioning takes the element out
    of the flow of the document, thus taking up
    no space
Positioning: Fixed                      WebDesignMeetup



 •  Is a subcategory of absolute positioning.
 •  The difference is that a fixed element’s
    containing block is the viewport. This allows
    you to create floating elements that always
    stay at the same position in the window
Floating box                              WebDesignMeetup



 •  A floated box can either be shifted to the
    left or the right until its outer edge touches
    the edge of its containing box or another
    floated box.
 •  floated boxes aren’t in the normal flow of
    the document, thus block boxes in the
    regular flow of the document behave as if
    the floated box wasn’t there.
Floating box   WebDesignMeetup
Floating box   WebDesignMeetup
Floating box   WebDesignMeetup
Grid System                                                      WebDesignMeetup




 Case	
  study:	
  Twi?er	
  Bootstrap’s	
  grid	
  system	
  

Weitere ähnliche Inhalte

Andere mochten auch

Singleton Pattern
Singleton PatternSingleton Pattern
Singleton PatternBorey Lim
 
Javascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsJavascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsNet7
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented WayBorey Lim
 
Cloud Computing: On the Air or Down to Earth - Beneficios para la Empresa
Cloud Computing: On the Air or Down to Earth - Beneficios para la EmpresaCloud Computing: On the Air or Down to Earth - Beneficios para la Empresa
Cloud Computing: On the Air or Down to Earth - Beneficios para la EmpresaSoftware Guru
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptmartinlippert
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)Nagarajan
 
Get Familiar With Git
Get Familiar With Git Get Familiar With Git
Get Familiar With Git Nigam Goyal
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學littlebtc
 

Andere mochten auch (9)

Singleton Pattern
Singleton PatternSingleton Pattern
Singleton Pattern
 
JavaScript and DOM
JavaScript and DOMJavaScript and DOM
JavaScript and DOM
 
Javascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsJavascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basics
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented Way
 
Cloud Computing: On the Air or Down to Earth - Beneficios para la Empresa
Cloud Computing: On the Air or Down to Earth - Beneficios para la EmpresaCloud Computing: On the Air or Down to Earth - Beneficios para la Empresa
Cloud Computing: On the Air or Down to Earth - Beneficios para la Empresa
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScript
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)
 
Get Familiar With Git
Get Familiar With Git Get Familiar With Git
Get Familiar With Git
 
寫給大家的 Git 教學
寫給大家的 Git 教學寫給大家的 Git 教學
寫給大家的 Git 教學
 

Ähnlich wie Css layout

WordPress Theming Best Practices
WordPress Theming Best PracticesWordPress Theming Best Practices
WordPress Theming Best PracticesBrian Krogsgard
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
About Layout in Firefox
About Layout in FirefoxAbout Layout in Firefox
About Layout in FirefoxJia Mi
 
From a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by StepFrom a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by StepEast Bay WordPress Meetup
 
10 Advanced CSS Techniques (You Wish You Knew More About)
10 Advanced CSS Techniques (You Wish You Knew More About)10 Advanced CSS Techniques (You Wish You Knew More About)
10 Advanced CSS Techniques (You Wish You Knew More About)Emily Lewis
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...Yandex
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
Future-Proof Responsive Web Design #RWD
Future-Proof Responsive Web Design #RWDFuture-Proof Responsive Web Design #RWD
Future-Proof Responsive Web Design #RWDDigital Surgeons
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of LayoutStephen Hay
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)Rajat Pratap Singh
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS LayoutZoe Gillenwater
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web DevelopmentNikhil Baby
 

Ähnlich wie Css layout (20)

CSS
CSSCSS
CSS
 
Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
CSS and CSS3
CSS and CSS3CSS and CSS3
CSS and CSS3
 
WordPress Theming Best Practices
WordPress Theming Best PracticesWordPress Theming Best Practices
WordPress Theming Best Practices
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
About Layout in Firefox
About Layout in FirefoxAbout Layout in Firefox
About Layout in Firefox
 
From a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by StepFrom a Fireworks Comp to a Genesis Child Theme, Step by Step
From a Fireworks Comp to a Genesis Child Theme, Step by Step
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
 
10 Advanced CSS Techniques (You Wish You Knew More About)
10 Advanced CSS Techniques (You Wish You Knew More About)10 Advanced CSS Techniques (You Wish You Knew More About)
10 Advanced CSS Techniques (You Wish You Knew More About)
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
Future-Proof Responsive Web Design #RWD
Future-Proof Responsive Web Design #RWDFuture-Proof Responsive Web Design #RWD
Future-Proof Responsive Web Design #RWD
 
Future proof rwd
Future proof rwdFuture proof rwd
Future proof rwd
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
 
Css intro
Css introCss intro
Css intro
 
Web development basics (Part-2)
Web development basics (Part-2)Web development basics (Part-2)
Web development basics (Part-2)
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS Layout
 
Bayt training
Bayt trainingBayt training
Bayt training
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web Development
 

Css layout

  • 1. CSS Layout Lim Borey Phnom  Penh  .  Sunday  3rd  February  2013   WebDesignMeetup @limborey www.limborey.com
  • 2. Content WebDesignMeetup •  Box Model •  Positioning –  Relative –  Absolute –  Fixed •  Grid System
  • 3. Box Model WebDesignMeetup Padding   Margin   Content   Border   #myBox { margin: 10px; padding: 5px; width: 70px; }
  • 4. Box Model WebDesignMeetup
  • 5. Positioning WebDesignMeetup •  2 types of virtual formatting elements –  Block-level element: div, p, h1, … –  Inline element: span, strong, … •  3 basic positioning schemes –  Relative –  Absolute –  Fixed
  • 6. Positioning: Relative WebDesignMeetup •  If you relatively position an element, it will stay exactly where it is.
  • 7. Positioning: Absolute WebDesignMeetup •  absolute positioning takes the element out of the flow of the document, thus taking up no space
  • 8. Positioning: Fixed WebDesignMeetup •  Is a subcategory of absolute positioning. •  The difference is that a fixed element’s containing block is the viewport. This allows you to create floating elements that always stay at the same position in the window
  • 9. Floating box WebDesignMeetup •  A floated box can either be shifted to the left or the right until its outer edge touches the edge of its containing box or another floated box. •  floated boxes aren’t in the normal flow of the document, thus block boxes in the regular flow of the document behave as if the floated box wasn’t there.
  • 10. Floating box WebDesignMeetup
  • 11. Floating box WebDesignMeetup
  • 12. Floating box WebDesignMeetup
  • 13. Grid System WebDesignMeetup Case  study:  Twi?er  Bootstrap’s  grid  system