SlideShare a Scribd company logo
CSS	
  and	
  Layout	
  

            Jussi	
  Pohjolainen	
  
Tampere	
  University	
  of	
  Applied	
  Sciences	
  
XHTML	
  Related	
  CSS	
  Elements	
  
•  You	
  can	
  group	
  XHTML	
  –	
  page	
  using	
  div	
  and	
  
   span	
  elements	
  
•  div	
  and	
  span	
  elements	
  do	
  not	
  do	
  anything,	
  
   unless	
  they	
  are	
  connected	
  to	
  css	
  
•  xhtml:	
  
    –  <p>Text text text <span class="important">text
       text</span>. Text text text.</p>
•  CSS:	
  
    –  span.important { color: RGB(255,0,0); }
span	
  and	
  div?	
  
•  By	
  using	
  div,	
  you	
  can	
  divide	
  xhtml	
  –	
  page	
  in	
  to	
  
   logical	
  pieces.	
  The	
  posiKon	
  of	
  these	
  are	
  
   defined	
  in	
  CSS	
  
     –  Example:	
  navigaKon,	
  header,	
  footer,	
  contents	
  
•  Span	
  is	
  used	
  to	
  give	
  layout	
  for	
  text	
  
span	
  and	
  div	
  
<div class="header">
   <h1>Title</h1>
</div>
<div class="contents">
   <p>Contents: <span
   class="highlight">this is different</span></p>
</div>
<div class="footer">
    <p>Copyright 2008</p>
</div>
Layout	
  Basics	
  
•  XHTML	
  page	
  is	
  divided	
  into	
  “boxes”	
  by	
  using	
  
   the	
  div-­‐element	
  
•  Box	
  consists	
  of	
  
    –  Content	
  
    –  Padding	
  
    –  Border	
  
    –  Marginal	
  
CSS	
  Box	
  Model	
  
CSS	
  Box	
  Model	
  
p.leipateksti {
    border: 1px solid black;
}
CSS	
  Box	
  Model	
  
p.leipateksti {
    border: 1px solid black;
    width: 50%;
}
CSS	
  Box	
  Model	
  
p.leipateksti {
    border: 1px solid black;
    padding: 20px;
}
CSS	
  Box	
  Model	
  
p.leipateksti {
    border: 1px solid black;
    margin: 20px;
}
Features	
  
•  Margins	
  
    –  margin-top
    –  margin-bottom
    –  margin-left
    –  margin-right
    –  All	
  together:	
  margin
•  Padding	
  
    –  padding-­‐top	
  
    –  padding-­‐boRom	
  
    –  padding-­‐leS	
  
    –  padding-­‐right	
  
    –  All	
  together:	
  padding
Features	
  
•  Borders	
  
     –    border-top-width
     –    border-bottom-width
     –    border-right-width
     –    border-left-width
     –    border-width
     –    border-color
     –    border-style (none, dotted, solid, double, groove, ridge, inset,
          outset)
•  CombinaKons	
  
    –  border-top
    –  border-right
    –  border-bottom
    –  border-left
•  All	
  together	
  
    –  border
Features	
  
•  width
•  height
•  float (none, left, right)
h1 {
                        Example	
  
    font-family:        Arial, Helvetica, sans-serif;
    color:              RGB(0,0,255);
    background-color:   RGB(200,200,200);
    border:             2px dotted RGB(0,0,0);
    padding:            10px;
    text-align:         center;
}
Example:	
  Layout	
  
<html>
<head><title>Otsikko</title></head>
<body>
    <!– whole page inside one div -->
    <div id="wholepage">

    </div>
  </body>
</html>
Example:	
  Layout	
  
<html>
<head><title>Otsikko</title></head>
<body>
    <div id="wholepage">
        <div id="header">
            <!– Title -->
        </div>
        <div id="navigation">
            <!– Navigation -->
        </div>
        <div id="contents">
            <!– Contents -->
        </div>
          <div id="footer">
            <!– Footer -->
        </div>
    </div>
  </body>
</html>
Example:	
  Layout	
  
#wholepage
{
    width:              100%;
    background-color:   RGB(255,255,255);
    color:              RGB(0,0,0);
    border:             1px solid RGB(100,100,100);
}
Example:	
  Layout	
  
#header
{
    padding:            10px;
    background-color:   RGB(220,220,220);
    border-bottom:      1px solid RGB(100,100,100);
}

#navigation
{
    float:              left;
    width:              160px;
    margin:             0;
    padding:            10px;
}
Example:	
  Layout	
  
#contents
{
    margin-left:        200px;
    border-left:        1px solid RGB(100,100,100);
    padding:            10px;
    max-width:          600px;
}

#footer
{
    padding:            10px;
    color:              RGB(100,100,100);
    background-color:   RGB(220,220,220);
    border-top:         1px solid RGB(100,100,100);
}
Result	
  
Ad

More Related Content

What's hot (20)

CSS Walktrough Internship Course
CSS Walktrough Internship CourseCSS Walktrough Internship Course
CSS Walktrough Internship Course
Zoltan Iszlai
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
Haml and Sass Introduction
Haml and Sass IntroductionHaml and Sass Introduction
Haml and Sass Introduction
Ethan Gunderson
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
Derek Christensen
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
mirahman
 
Css introduction
Css  introductionCss  introduction
Css introduction
Nicha Jutasirivongse
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
Gerson Abesamis
 
2 introduction css
2 introduction css2 introduction css
2 introduction css
Jalpesh Vasa
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
iFour Institute - Sustainable Learning
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
Christopher Schmitt
 
Css
CssCss
Css
shinyduela
 
Html
HtmlHtml
Html
Nidhi mishra
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
Ferdous Mahmud Shaon
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
Fundamental CSS3
Fundamental CSS3Fundamental CSS3
Fundamental CSS3
Achmad Solichin
 
Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
Kianosh Pourian
 
CSS3: Simply Responsive
CSS3: Simply ResponsiveCSS3: Simply Responsive
CSS3: Simply Responsive
Denise Jacobs
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
GuruPada Das
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
Russ Weakley
 
Basic HTML & CSS
Basic HTML & CSSBasic HTML & CSS
Basic HTML & CSS
John Nelson
 

Viewers also liked (20)

Intro to MIDP Development
Intro to MIDP DevelopmentIntro to MIDP Development
Intro to MIDP Development
Jussi Pohjolainen
 
Android Security, Signing and Publishing
Android Security, Signing and PublishingAndroid Security, Signing and Publishing
Android Security, Signing and Publishing
Jussi Pohjolainen
 
Introduction to Mobile Programming 2 - course
Introduction to Mobile Programming 2 - courseIntroduction to Mobile Programming 2 - course
Introduction to Mobile Programming 2 - course
Jussi Pohjolainen
 
iPhone OS Platform
iPhone OS PlatformiPhone OS Platform
iPhone OS Platform
Jussi Pohjolainen
 
MIDP GUI Development: Alert, List, Form, TextBox
MIDP GUI Development: Alert, List, Form, TextBoxMIDP GUI Development: Alert, List, Form, TextBox
MIDP GUI Development: Alert, List, Form, TextBox
Jussi Pohjolainen
 
Graphics, Threads and HTTPConnections in MIDLets
Graphics, Threads and HTTPConnections in MIDLetsGraphics, Threads and HTTPConnections in MIDLets
Graphics, Threads and HTTPConnections in MIDLets
Jussi Pohjolainen
 
MIDP: Game API
MIDP: Game APIMIDP: Game API
MIDP: Game API
Jussi Pohjolainen
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image Items
Jussi Pohjolainen
 
iPhone: Http Connection
iPhone: Http ConnectioniPhone: Http Connection
iPhone: Http Connection
Jussi Pohjolainen
 
Introduction to Web Standards
Introduction to Web StandardsIntroduction to Web Standards
Introduction to Web Standards
Jussi Pohjolainen
 
.NET Multithreading and File I/O
.NET Multithreading and File I/O.NET Multithreading and File I/O
.NET Multithreading and File I/O
Jussi Pohjolainen
 
iOS: Frameworks and Delegation
iOS: Frameworks and DelegationiOS: Frameworks and Delegation
iOS: Frameworks and Delegation
Jussi Pohjolainen
 
C++: Interface as Concept
C++: Interface as ConceptC++: Interface as Concept
C++: Interface as Concept
Jussi Pohjolainen
 
MIDP: Persistant Storage
MIDP: Persistant StorageMIDP: Persistant Storage
MIDP: Persistant Storage
Jussi Pohjolainen
 
Introduction to Web Application Course
Introduction to Web Application CourseIntroduction to Web Application Course
Introduction to Web Application Course
Jussi Pohjolainen
 
libGDX: Scene2D
libGDX: Scene2DlibGDX: Scene2D
libGDX: Scene2D
Jussi Pohjolainen
 
JavaScript Inheritance
JavaScript InheritanceJavaScript Inheritance
JavaScript Inheritance
Jussi Pohjolainen
 
iPhone University Developer Program
iPhone University Developer ProgramiPhone University Developer Program
iPhone University Developer Program
Jussi Pohjolainen
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
Jussi Pohjolainen
 
Android Security, Signing and Publishing
Android Security, Signing and PublishingAndroid Security, Signing and Publishing
Android Security, Signing and Publishing
Jussi Pohjolainen
 
Introduction to Mobile Programming 2 - course
Introduction to Mobile Programming 2 - courseIntroduction to Mobile Programming 2 - course
Introduction to Mobile Programming 2 - course
Jussi Pohjolainen
 
MIDP GUI Development: Alert, List, Form, TextBox
MIDP GUI Development: Alert, List, Form, TextBoxMIDP GUI Development: Alert, List, Form, TextBox
MIDP GUI Development: Alert, List, Form, TextBox
Jussi Pohjolainen
 
Graphics, Threads and HTTPConnections in MIDLets
Graphics, Threads and HTTPConnections in MIDLetsGraphics, Threads and HTTPConnections in MIDLets
Graphics, Threads and HTTPConnections in MIDLets
Jussi Pohjolainen
 
MIDP: Form Custom and Image Items
MIDP: Form Custom and Image ItemsMIDP: Form Custom and Image Items
MIDP: Form Custom and Image Items
Jussi Pohjolainen
 
Introduction to Web Standards
Introduction to Web StandardsIntroduction to Web Standards
Introduction to Web Standards
Jussi Pohjolainen
 
.NET Multithreading and File I/O
.NET Multithreading and File I/O.NET Multithreading and File I/O
.NET Multithreading and File I/O
Jussi Pohjolainen
 
iOS: Frameworks and Delegation
iOS: Frameworks and DelegationiOS: Frameworks and Delegation
iOS: Frameworks and Delegation
Jussi Pohjolainen
 
Introduction to Web Application Course
Introduction to Web Application CourseIntroduction to Web Application Course
Introduction to Web Application Course
Jussi Pohjolainen
 
iPhone University Developer Program
iPhone University Developer ProgramiPhone University Developer Program
iPhone University Developer Program
Jussi Pohjolainen
 
Implementing a Simple Game using libGDX
Implementing a Simple Game using libGDXImplementing a Simple Game using libGDX
Implementing a Simple Game using libGDX
Jussi Pohjolainen
 
Ad

Similar to CSS and Layout (20)

Web - CSS 1.pptx
Web - CSS 1.pptxWeb - CSS 1.pptx
Web - CSS 1.pptx
haroon451422
 
CSS
CSSCSS
CSS
Raja Kumar Ranjan
 
Layout with CSS
Layout with CSSLayout with CSS
Layout with CSS
Mike Crabb
 
WT CSS
WT  CSSWT  CSS
WT CSS
Mohan186867
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
Hawkman Academy
 
CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
NavyaEnugala
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
kushwahanitesh592
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
Senthil Kumar
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
David Engel
 
Css & css3
Css & css3Css & css3
Css & css3
isha
 
css-note.pptx
css-note.pptxcss-note.pptx
css-note.pptx
Samay16
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
Mukesh Kumar
 
6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt
VARNITBHASKAR1
 
Web Development - Lecture 6
Web Development - Lecture 6Web Development - Lecture 6
Web Development - Lecture 6
Syed Shahzaib Sohail
 
Intro to HTML & CSS
Intro to HTML & CSSIntro to HTML & CSS
Intro to HTML & CSS
Colin Loretz
 
Layouts
Layouts Layouts
Layouts
kjkleindorfer
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 
CSS
CSSCSS
CSS
Mallikarjuna G D
 
Ad

More from Jussi Pohjolainen (20)

Moved to Speakerdeck
Moved to SpeakerdeckMoved to Speakerdeck
Moved to Speakerdeck
Jussi Pohjolainen
 
Java Web Services
Java Web ServicesJava Web Services
Java Web Services
Jussi Pohjolainen
 
Box2D and libGDX
Box2D and libGDXBox2D and libGDX
Box2D and libGDX
Jussi Pohjolainen
 
libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and Preferences
Jussi Pohjolainen
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
Jussi Pohjolainen
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
Jussi Pohjolainen
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDX
Jussi Pohjolainen
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
Jussi Pohjolainen
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Jussi Pohjolainen
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
 
libGDX: User Input
libGDX: User InputlibGDX: User Input
libGDX: User Input
Jussi Pohjolainen
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
Jussi Pohjolainen
 
Android Threading
Android ThreadingAndroid Threading
Android Threading
Jussi Pohjolainen
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Jussi Pohjolainen
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
Jussi Pohjolainen
 
Intro to Asha UI
Intro to Asha UIIntro to Asha UI
Intro to Asha UI
Jussi Pohjolainen
 
Intro to Java ME and Asha Platform
Intro to Java ME and Asha PlatformIntro to Java ME and Asha Platform
Intro to Java ME and Asha Platform
Jussi Pohjolainen
 
Intro to PhoneGap
Intro to PhoneGapIntro to PhoneGap
Intro to PhoneGap
Jussi Pohjolainen
 
libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and Preferences
Jussi Pohjolainen
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
Jussi Pohjolainen
 
Intro to Building Android Games using libGDX
Intro to Building Android Games using libGDXIntro to Building Android Games using libGDX
Intro to Building Android Games using libGDX
Jussi Pohjolainen
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
Jussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
Jussi Pohjolainen
 
Building Android games using LibGDX
Building Android games using LibGDXBuilding Android games using LibGDX
Building Android games using LibGDX
Jussi Pohjolainen
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Jussi Pohjolainen
 
Creating Games for Asha - platform
Creating Games for Asha - platformCreating Games for Asha - platform
Creating Games for Asha - platform
Jussi Pohjolainen
 
Intro to Java ME and Asha Platform
Intro to Java ME and Asha PlatformIntro to Java ME and Asha Platform
Intro to Java ME and Asha Platform
Jussi Pohjolainen
 

Recently uploaded (20)

SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Kenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 CohortKenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 Cohort
EducationNC
 
Grade 3 - English - Printable Worksheet (PDF Format)
Grade 3 - English - Printable Worksheet  (PDF Format)Grade 3 - English - Printable Worksheet  (PDF Format)
Grade 3 - English - Printable Worksheet (PDF Format)
Sritoma Majumder
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.
MCH
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Contact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: OptometryContact Lens:::: An Overview.pptx.: Optometry
Contact Lens:::: An Overview.pptx.: Optometry
MushahidRaza8
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Kenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 CohortKenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 Cohort
EducationNC
 
Grade 3 - English - Printable Worksheet (PDF Format)
Grade 3 - English - Printable Worksheet  (PDF Format)Grade 3 - English - Printable Worksheet  (PDF Format)
Grade 3 - English - Printable Worksheet (PDF Format)
Sritoma Majumder
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.03#UNTAGGED. Generosity in architecture.
03#UNTAGGED. Generosity in architecture.
MCH
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 

CSS and Layout

  • 1. CSS  and  Layout   Jussi  Pohjolainen   Tampere  University  of  Applied  Sciences  
  • 2. XHTML  Related  CSS  Elements   •  You  can  group  XHTML  –  page  using  div  and   span  elements   •  div  and  span  elements  do  not  do  anything,   unless  they  are  connected  to  css   •  xhtml:   –  <p>Text text text <span class="important">text text</span>. Text text text.</p> •  CSS:   –  span.important { color: RGB(255,0,0); }
  • 3. span  and  div?   •  By  using  div,  you  can  divide  xhtml  –  page  in  to   logical  pieces.  The  posiKon  of  these  are   defined  in  CSS   –  Example:  navigaKon,  header,  footer,  contents   •  Span  is  used  to  give  layout  for  text  
  • 4. span  and  div   <div class="header"> <h1>Title</h1> </div> <div class="contents"> <p>Contents: <span class="highlight">this is different</span></p> </div> <div class="footer"> <p>Copyright 2008</p> </div>
  • 5. Layout  Basics   •  XHTML  page  is  divided  into  “boxes”  by  using   the  div-­‐element   •  Box  consists  of   –  Content   –  Padding   –  Border   –  Marginal  
  • 7. CSS  Box  Model   p.leipateksti { border: 1px solid black; }
  • 8. CSS  Box  Model   p.leipateksti { border: 1px solid black; width: 50%; }
  • 9. CSS  Box  Model   p.leipateksti { border: 1px solid black; padding: 20px; }
  • 10. CSS  Box  Model   p.leipateksti { border: 1px solid black; margin: 20px; }
  • 11. Features   •  Margins   –  margin-top –  margin-bottom –  margin-left –  margin-right –  All  together:  margin •  Padding   –  padding-­‐top   –  padding-­‐boRom   –  padding-­‐leS   –  padding-­‐right   –  All  together:  padding
  • 12. Features   •  Borders   –  border-top-width –  border-bottom-width –  border-right-width –  border-left-width –  border-width –  border-color –  border-style (none, dotted, solid, double, groove, ridge, inset, outset) •  CombinaKons   –  border-top –  border-right –  border-bottom –  border-left •  All  together   –  border
  • 13. Features   •  width •  height •  float (none, left, right)
  • 14. h1 { Example   font-family: Arial, Helvetica, sans-serif; color: RGB(0,0,255); background-color: RGB(200,200,200); border: 2px dotted RGB(0,0,0); padding: 10px; text-align: center; }
  • 15. Example:  Layout   <html> <head><title>Otsikko</title></head> <body> <!– whole page inside one div --> <div id="wholepage"> </div> </body> </html>
  • 16. Example:  Layout   <html> <head><title>Otsikko</title></head> <body> <div id="wholepage"> <div id="header"> <!– Title --> </div> <div id="navigation"> <!– Navigation --> </div> <div id="contents"> <!– Contents --> </div> <div id="footer"> <!– Footer --> </div> </div> </body> </html>
  • 17. Example:  Layout   #wholepage { width: 100%; background-color: RGB(255,255,255); color: RGB(0,0,0); border: 1px solid RGB(100,100,100); }
  • 18. Example:  Layout   #header { padding: 10px; background-color: RGB(220,220,220); border-bottom: 1px solid RGB(100,100,100); } #navigation { float: left; width: 160px; margin: 0; padding: 10px; }
  • 19. Example:  Layout   #contents { margin-left: 200px; border-left: 1px solid RGB(100,100,100); padding: 10px; max-width: 600px; } #footer { padding: 10px; color: RGB(100,100,100); background-color: RGB(220,220,220); border-top: 1px solid RGB(100,100,100); }