SlideShare una empresa de Scribd logo
1 de 28
Introduction to Web 
Technologies 
Lecture 3 
Julie Iskander, 
MSc. Communication and Electronics
Visual 
Formatting and 
Layout
CSS layout and formatting 
 After parsing the html into a document tree (DOM) 
 Each node is rendered as one or more rectangular boxes 
 Types of Boxes: 
 Block Boxes : 
 for block elements ex. div, p 
 Elements with display : block| list-item| table; 
 Inline Boxes: for inline elements 
 For inline elements ex.span, b, em 
 Elements with display : inline | inline-table | inline-block;
BOX Model 
 Applies to block-level elements
BOX Model 
 Applies to block-level elements 
 Overall calculated dimension of element = 
 Height/width + margin + padding + border 
.box 
{ 
width:300px; 
height:200px; 
padding:10px; 
margin:15px; 
border: 1px solid #000; 
}
DEMO 
How to center a block?
Positioning 
 Positioning Schemes: 
 Normal Flow (includes relative positioning) 
 Floating 
 Absolute Position (includes fixed positioning) 
 http://www.barelyfitz.com/screencast/html-training/ 
css/positioning/
position : static 
 Default 
 Elements rendered in order of normal flow
position : relative 
 At start works just like static positioning 
 To shift box, use : 
 top: px, %, auto,inherit; 
 bottom: px, %, auto,inherit; 
 left: px, %, auto,inherit; 
 right: px, %, auto,inherit; 
 W.R.T the flow, the element in its original position. When 
shifted a hole is left in it’s place
position : absolute 
 Element is completely removed from document flow. 
 No effect on next elements, 
 Can overlap other contents 
 Positioned w.r.t. the next parent element with relative (or 
absolute) positioning. 
 If no such parent, 
 it will be placed relatively to the page itself. 
 To determine position, use : 
 top, bottom, left and right (must take values, or they take the original values of 
their place in the document flow) 
 width and height
position : fixed 
 Similar to absolute positioning. 
 Positioned relative to viewport 
 Won’t move with scrolling, always fixed. 
 Not supported by IE 6 or earlier. 
 To determine position, use : 
 top, bottom, left and right 
 width and height
Floating 
 float: none | left | right 
 Floated elements is shifted to one side and all the others 
will flow along the opposite side 
 Taken out of the normal flow 
 For a containing block to accommodate a floating child, 
must be floating or overflow property not visible 
 Can’t float up or down.
Clearing 
 clear : both | left | right; 
 To force an element to start below any floated 
element 
 Mainly used to make footer below all floated column
Note 
 If position : absolute or floated and width:auto 
 Generated box shrink to dimension of content 
 Recommended to set width 
 if a block contains only floated and absolutely 
positioned elements  then it has no content, zero 
dimension 
 If width:100% don’t use margins, paddings or 
borders to avoid overflowing or pushing elements 
wider than available. 
 Recommended use width : auto and apply margin, 
padding and border only
DEMO 
How to create a menu?
z-index: number 
 Is the positioning along the z-index 
 Larger z-index elements is rendered in front of lower 
z-index elements 
 Can take –ve values
At-rules 
 Are instructions to the CSS parser. 
 Example: 
 @import: 
 For importing a css into another. 
 @media: 
 Specifies one or more rules to be applied on a certain 
media type
Before we continue, what 
is media types ?!! 
 Examples of Media Types: 
 All: Suitable for all devices. 
 Braille: Intended for braille tactile feedback devices. 
 Embossed: Intended for paged braille printers. 
 Handheld: Intended for handheld devices (typically small 
screen, limited bandwidth). 
 Print: Intended for paged material and for documents viewed 
on screen in print preview mode. Please consult the section on 
paged media for information about formatting issues that are 
specific to paged media. 
 Screen: Intended primarily for color computer screens.
@import 
 Fully supported by FF, Safari, Opera, Chrome, IE 9+ 
 Format : 
@import {URI | string} [media type,…….]; 
 To import one css into another. 
 Example: 
@import url(/css/screen.css) screen 
@import “mobile.css” handheld 
 Must precede all rule sets, if it follows one/more rule 
sets it is ignored.
@media 
 Fully supported by Opera 9.2+, Safary 3+, chrome 
2+ 
 Buggy support by IE 6+, FF1+ 
 Format: 
@media media type,……{ 
ruleset 
} 
 To specify rules to be applied to specific media only
media query 
 CSS 3 extension to media types, limited support 
 A logical expression, evaluated to true/false, to test whether 
device features to determine whether to apply the css or no. 
 Used in <link> tag, @import, @media at-rules. 
 CSS is only applied if evaluated to true. 
 Examples: 
<link rel=“stylesheet” type=“text/css” href=“/style.css” media=“all and (color)” 
 all output media that are capable of color. 
@media handheld and (min-width:20em){…….} 
 Handheld devices with width at least 20em 
 http://reference.sitepoint.com/css/mediaqueries
Example
Example
References 
 http://reference.sitepoint.com/css 
 http://www.w3.org/TR/CSS21/ 
 http://www.w3.org/TR/CSS2/ 
 http://www.w3.org/TR/2011/NOTE-css-2010- 
20110512/ 
 https://developer.mozilla.org/en-US/docs/CSS 
 http://www.daaq.net/old/css/index.php?page=using+ 
css

Más contenido relacionado

Destacado (10)

Karneval (www.rbs-ifie.at)
Karneval (www.rbs-ifie.at)Karneval (www.rbs-ifie.at)
Karneval (www.rbs-ifie.at)
 
Economics chapter2
Economics chapter2Economics chapter2
Economics chapter2
 
Unser tannenwald adventskalender
Unser tannenwald adventskalenderUnser tannenwald adventskalender
Unser tannenwald adventskalender
 
FRC Learning
FRC LearningFRC Learning
FRC Learning
 
ASCEND Creation Time station
ASCEND Creation Time stationASCEND Creation Time station
ASCEND Creation Time station
 
семінар захід
семінар західсемінар захід
семінар захід
 
Chapter 2 marketing
Chapter 2 marketingChapter 2 marketing
Chapter 2 marketing
 
Navajos
NavajosNavajos
Navajos
 
Erasmus+ κα1
Erasmus+ κα1Erasmus+ κα1
Erasmus+ κα1
 
Navajo Code Talker powerpoint presentation by NNWO Executive Director Clara L...
Navajo Code Talker powerpoint presentation by NNWO Executive Director Clara L...Navajo Code Talker powerpoint presentation by NNWO Executive Director Clara L...
Navajo Code Talker powerpoint presentation by NNWO Executive Director Clara L...
 

Similar a HTML and CSS part 3 (20)

How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
CSS
CSSCSS
CSS
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
CSS_Dibbo
CSS_DibboCSS_Dibbo
CSS_Dibbo
 
Advanced CSS.pptx
Advanced CSS.pptxAdvanced CSS.pptx
Advanced CSS.pptx
 
INTEGRATION (HTML/CSS) The technology behind AESTHETICS
INTEGRATION (HTML/CSS) The technology behind AESTHETICSINTEGRATION (HTML/CSS) The technology behind AESTHETICS
INTEGRATION (HTML/CSS) The technology behind AESTHETICS
 
CSS3 notes
CSS3 notesCSS3 notes
CSS3 notes
 
Css training
Css trainingCss training
Css training
 
CSS
CSSCSS
CSS
 
Basic css
Basic cssBasic css
Basic css
 
Media queries A to Z
Media queries A to ZMedia queries A to Z
Media queries A to Z
 
Css advanced – session 4
Css advanced – session 4Css advanced – session 4
Css advanced – session 4
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Lecture-8.pptx
Lecture-8.pptxLecture-8.pptx
Lecture-8.pptx
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Art of css
Art of cssArt of css
Art of css
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web Development
 
Css
CssCss
Css
 
CSS3 PPT.pptx
CSS3 PPT.pptxCSS3 PPT.pptx
CSS3 PPT.pptx
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 

Más de Julie Iskander (20)

HTML 5
HTML 5HTML 5
HTML 5
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
 
Design Pattern lecture 3
Design Pattern lecture 3Design Pattern lecture 3
Design Pattern lecture 3
 
Scriptaculous
ScriptaculousScriptaculous
Scriptaculous
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Design Pattern lecture 4
Design Pattern lecture 4Design Pattern lecture 4
Design Pattern lecture 4
 
Design Pattern lecture 2
Design Pattern lecture 2Design Pattern lecture 2
Design Pattern lecture 2
 
Design Pattern lecture 1
Design Pattern lecture 1Design Pattern lecture 1
Design Pattern lecture 1
 
Ajax and ASP.NET AJAX
Ajax and ASP.NET AJAXAjax and ASP.NET AJAX
Ajax and ASP.NET AJAX
 
jQuery
jQueryjQuery
jQuery
 
ASP.NET Lecture 5
ASP.NET Lecture 5ASP.NET Lecture 5
ASP.NET Lecture 5
 
ASP.NET lecture 8
ASP.NET lecture 8ASP.NET lecture 8
ASP.NET lecture 8
 
ASP.NET Lecture 7
ASP.NET Lecture 7ASP.NET Lecture 7
ASP.NET Lecture 7
 
ASP.NET Lecture 6
ASP.NET Lecture 6ASP.NET Lecture 6
ASP.NET Lecture 6
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
ASP.NET Lecture 3
ASP.NET Lecture 3ASP.NET Lecture 3
ASP.NET Lecture 3
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
AJAX and JSON
AJAX and JSONAJAX and JSON
AJAX and JSON
 

Último

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Último (20)

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

HTML and CSS part 3

  • 1. Introduction to Web Technologies Lecture 3 Julie Iskander, MSc. Communication and Electronics
  • 3. CSS layout and formatting  After parsing the html into a document tree (DOM)  Each node is rendered as one or more rectangular boxes  Types of Boxes:  Block Boxes :  for block elements ex. div, p  Elements with display : block| list-item| table;  Inline Boxes: for inline elements  For inline elements ex.span, b, em  Elements with display : inline | inline-table | inline-block;
  • 4. BOX Model  Applies to block-level elements
  • 5. BOX Model  Applies to block-level elements  Overall calculated dimension of element =  Height/width + margin + padding + border .box { width:300px; height:200px; padding:10px; margin:15px; border: 1px solid #000; }
  • 6. DEMO How to center a block?
  • 7.
  • 8.
  • 9. Positioning  Positioning Schemes:  Normal Flow (includes relative positioning)  Floating  Absolute Position (includes fixed positioning)  http://www.barelyfitz.com/screencast/html-training/ css/positioning/
  • 10. position : static  Default  Elements rendered in order of normal flow
  • 11. position : relative  At start works just like static positioning  To shift box, use :  top: px, %, auto,inherit;  bottom: px, %, auto,inherit;  left: px, %, auto,inherit;  right: px, %, auto,inherit;  W.R.T the flow, the element in its original position. When shifted a hole is left in it’s place
  • 12. position : absolute  Element is completely removed from document flow.  No effect on next elements,  Can overlap other contents  Positioned w.r.t. the next parent element with relative (or absolute) positioning.  If no such parent,  it will be placed relatively to the page itself.  To determine position, use :  top, bottom, left and right (must take values, or they take the original values of their place in the document flow)  width and height
  • 13. position : fixed  Similar to absolute positioning.  Positioned relative to viewport  Won’t move with scrolling, always fixed.  Not supported by IE 6 or earlier.  To determine position, use :  top, bottom, left and right  width and height
  • 14. Floating  float: none | left | right  Floated elements is shifted to one side and all the others will flow along the opposite side  Taken out of the normal flow  For a containing block to accommodate a floating child, must be floating or overflow property not visible  Can’t float up or down.
  • 15. Clearing  clear : both | left | right;  To force an element to start below any floated element  Mainly used to make footer below all floated column
  • 16. Note  If position : absolute or floated and width:auto  Generated box shrink to dimension of content  Recommended to set width  if a block contains only floated and absolutely positioned elements  then it has no content, zero dimension  If width:100% don’t use margins, paddings or borders to avoid overflowing or pushing elements wider than available.  Recommended use width : auto and apply margin, padding and border only
  • 17. DEMO How to create a menu?
  • 18.
  • 19.
  • 20. z-index: number  Is the positioning along the z-index  Larger z-index elements is rendered in front of lower z-index elements  Can take –ve values
  • 21. At-rules  Are instructions to the CSS parser.  Example:  @import:  For importing a css into another.  @media:  Specifies one or more rules to be applied on a certain media type
  • 22. Before we continue, what is media types ?!!  Examples of Media Types:  All: Suitable for all devices.  Braille: Intended for braille tactile feedback devices.  Embossed: Intended for paged braille printers.  Handheld: Intended for handheld devices (typically small screen, limited bandwidth).  Print: Intended for paged material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media.  Screen: Intended primarily for color computer screens.
  • 23. @import  Fully supported by FF, Safari, Opera, Chrome, IE 9+  Format : @import {URI | string} [media type,…….];  To import one css into another.  Example: @import url(/css/screen.css) screen @import “mobile.css” handheld  Must precede all rule sets, if it follows one/more rule sets it is ignored.
  • 24. @media  Fully supported by Opera 9.2+, Safary 3+, chrome 2+  Buggy support by IE 6+, FF1+  Format: @media media type,……{ ruleset }  To specify rules to be applied to specific media only
  • 25. media query  CSS 3 extension to media types, limited support  A logical expression, evaluated to true/false, to test whether device features to determine whether to apply the css or no.  Used in <link> tag, @import, @media at-rules.  CSS is only applied if evaluated to true.  Examples: <link rel=“stylesheet” type=“text/css” href=“/style.css” media=“all and (color)”  all output media that are capable of color. @media handheld and (min-width:20em){…….}  Handheld devices with width at least 20em  http://reference.sitepoint.com/css/mediaqueries
  • 28. References  http://reference.sitepoint.com/css  http://www.w3.org/TR/CSS21/  http://www.w3.org/TR/CSS2/  http://www.w3.org/TR/2011/NOTE-css-2010- 20110512/  https://developer.mozilla.org/en-US/docs/CSS  http://www.daaq.net/old/css/index.php?page=using+ css

Notas del editor

  1. Demo for difference between div and span
  2. Display: none  the element doesn’t appear not even in the structure Visibility : hidden  creates an invisible box
  3. IE 5 box model (padding and border shrinks content area) Total width= width + margins ONLY
  4. Total width = 15 + 1 + 10 + 300 + 10 + 1 + 15 = 352px Total height = 15 + 1 + 10 + 200 + 10 + 1 + 15 = 252px width | height: length | percentage wrt. Containing block dimension | none | auto  no –ve is allowed
  5. If left and right specified ltr, left used  rtl, right used If top and bottom specified top used
  6. If left and right specified ltr, left used  rtl, right used If top and bottom specified top used
  7. If left and right specified ltr, left used  rtl, right used If top and bottom specified top used
  8. overflow : visible | hidden | scroll | auto | inherit
  9. create a menu
  10. Others @charset: To specify character encoding of external css @page: to specify margins for page box in paged media @font-face : to define custom font properties @namespace: for XML namespaces in CSS3
  11. body { background-color: #fff; color: #000; } /* The following rule will be ignored */ @import url("other.css");
  12. CSS 2
  13. @import url(/style.css) screen and (min-width:800px) and (max-width:1280px);  screen-based device with width between 800 and 1280 px More in http://reference.sitepoint.com/css/mediaqueries