SlideShare uma empresa Scribd logo
1 de 19
CSS Selectors CSS Box Model
CSS Selectors Tag, Class, ID, Compound Use CSS Selectors to define properties for the structure and presentation of your site. This is the key to defining specific properties for specific parts of your design.
CSS Selectors Tag :  properties defined for an HTML tag. Class :  properties defined for an HTML tag using a class or a <span> tag. ID :  properties defined for an element or div using an id . Compound :  properties defined using multiple selector types .
CSS Selectors body {margin: 10px 0;} Selector Property Value Declaration
CSS Selectors body {margin: 10px 0;} Tag* :  properties defined for an HTML tag.  (*Also referred to as Type, Element)
CSS Selectors body {margin: 10px 0;} <body> Everything within the body will start out with this property.  </body>  Tag
CSS Selectors .red {margin: 15px; color: red;} Class :  properties defined for an HTML tag using a class or a <span> tag.
CSS Selectors .red {margin: 15px; color: red;} <p class= ” red ” >This is a paragraph of text in red.</p>  These are <span class= ” red ” >words in red.</span>  Class
CSS Selectors #wrapper {margin :0 auto;} ID :  properties defined for an element or div using an id.
CSS Selectors #wrapper {margin :0 auto;} <div id= ” wrapper ” ></div>  ID
CSS Selectors #content p {margin :0;} Compound :  properties defined using multiple  selector types.
CSS Selectors #content p {margin :0;} <div id= ” content ” > <p>This is a paragraph of text in the content div.</p> </div>  Compound
CSS Box Model How do you position content? You position content in your page by using a combination of margins, padding and floats. But, in order to get your positioning and layout correct, you must know how the CSS Box Model works.
CSS Box Model content
CSS Box Model 40 px 10 px 100 px 450 px content
CSS Box Model 10 px 1 px 50 px ??? px 500 px content
CSS Box Model total box width =   content area width +   left padding + right padding +  left border + right border +   left margin + right margin
CSS Box Model #content {width: 200px;border: 1px solid #900;padding: 10px;margin: 0;background: #fee;} What is the total box width?
CSS Box Model #content {width: ???px;border: 1px solid #000;padding: 20px;margin: 10;} If the total box width is 400px, what is the width  of the content area?

Mais conteúdo relacionado

Mais procurados

CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and Dimensions
Gerson Abesamis
 

Mais procurados (17)

Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
Css ppt
Css pptCss ppt
Css ppt
 
Css margins
Css marginsCss margins
Css margins
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and Dimensions
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
Sass
SassSass
Sass
 
Intro to HTML + CSS
Intro to HTML + CSSIntro to HTML + CSS
Intro to HTML + CSS
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Web Development Basics: HOW TO in HTML
Web Development Basics: HOW TO in HTMLWeb Development Basics: HOW TO in HTML
Web Development Basics: HOW TO in HTML
 
Lab#7 CSS Box Model
Lab#7 CSS Box ModelLab#7 CSS Box Model
Lab#7 CSS Box Model
 
Css intro
Css introCss intro
Css intro
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSS
 
Css
CssCss
Css
 
Css
CssCss
Css
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 

Destaque

CSS: selectors and the box model
CSS: selectors and the box modelCSS: selectors and the box model
CSS: selectors and the box model
Idan Gazit
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignIntroduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesign
ipmindthegap
 

Destaque (20)

Css box model
Css  box modelCss  box model
Css box model
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
 
CSS: selectors and the box model
CSS: selectors and the box modelCSS: selectors and the box model
CSS: selectors and the box model
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box ModelCSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
CSS Selectors
CSS SelectorsCSS Selectors
CSS Selectors
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
 
CSS Layout Techniques
CSS Layout TechniquesCSS Layout Techniques
CSS Layout Techniques
 
The CSS Box Model
The CSS Box ModelThe CSS Box Model
The CSS Box Model
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Simplifying CSS Selectors
Simplifying CSS SelectorsSimplifying CSS Selectors
Simplifying CSS Selectors
 
Maintainable CSS
Maintainable CSSMaintainable CSS
Maintainable CSS
 
HTML5 Quick Start
HTML5 Quick StartHTML5 Quick Start
HTML5 Quick Start
 
Css 2010
Css 2010Css 2010
Css 2010
 
Postman
PostmanPostman
Postman
 
Lecture3
Lecture3Lecture3
Lecture3
 
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignIntroduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesign
 
Google's Principle's of Mobile Website Design
Google's Principle's of Mobile Website DesignGoogle's Principle's of Mobile Website Design
Google's Principle's of Mobile Website Design
 
Next Steps in Responsive Design
Next Steps in Responsive DesignNext Steps in Responsive Design
Next Steps in Responsive Design
 

Semelhante a CSS, CSS Selectors, CSS Box Model

CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
Shawn Calvert
 
Class andid
Class andidClass andid
Class andid
jovy_75
 

Semelhante a CSS, CSS Selectors, CSS Box Model (20)

CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
 
Iml140 cs sbasics_week5
Iml140 cs sbasics_week5Iml140 cs sbasics_week5
Iml140 cs sbasics_week5
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
Css
CssCss
Css
 
Rational HATS and CSS
Rational HATS and CSSRational HATS and CSS
Rational HATS and CSS
 
Introducing CSS Selectors.docx
Introducing CSS Selectors.docxIntroducing CSS Selectors.docx
Introducing CSS Selectors.docx
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
Class andid
Class andidClass andid
Class andid
 
Week3 css
Week3 cssWeek3 css
Week3 css
 
CSS For Coders
CSS For CodersCSS For Coders
CSS For Coders
 
Css
CssCss
Css
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
 
Css.html
Css.htmlCss.html
Css.html
 
css.ppt
css.pptcss.ppt
css.ppt
 
Css basics
Css basicsCss basics
Css basics
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 

Mais de jamiecavanaugh (6)

IxD Programs + Community Colleges = New Opportunities
IxD Programs + Community Colleges = New OpportunitiesIxD Programs + Community Colleges = New Opportunities
IxD Programs + Community Colleges = New Opportunities
 
IxD Information Session
IxD Information SessionIxD Information Session
IxD Information Session
 
Wireframing
WireframingWireframing
Wireframing
 
What is User Centered Design?
What is User Centered Design?What is User Centered Design?
What is User Centered Design?
 
What Makes an App Great?
What Makes an App Great?What Makes an App Great?
What Makes an App Great?
 
Mobile is all about touch
Mobile is all about touchMobile is all about touch
Mobile is all about touch
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Último (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

CSS, CSS Selectors, CSS Box Model

  • 1. CSS Selectors CSS Box Model
  • 2. CSS Selectors Tag, Class, ID, Compound Use CSS Selectors to define properties for the structure and presentation of your site. This is the key to defining specific properties for specific parts of your design.
  • 3. CSS Selectors Tag : properties defined for an HTML tag. Class : properties defined for an HTML tag using a class or a <span> tag. ID : properties defined for an element or div using an id . Compound : properties defined using multiple selector types .
  • 4. CSS Selectors body {margin: 10px 0;} Selector Property Value Declaration
  • 5. CSS Selectors body {margin: 10px 0;} Tag* : properties defined for an HTML tag. (*Also referred to as Type, Element)
  • 6. CSS Selectors body {margin: 10px 0;} <body> Everything within the body will start out with this property. </body> Tag
  • 7. CSS Selectors .red {margin: 15px; color: red;} Class : properties defined for an HTML tag using a class or a <span> tag.
  • 8. CSS Selectors .red {margin: 15px; color: red;} <p class= ” red ” >This is a paragraph of text in red.</p> These are <span class= ” red ” >words in red.</span> Class
  • 9. CSS Selectors #wrapper {margin :0 auto;} ID : properties defined for an element or div using an id.
  • 10. CSS Selectors #wrapper {margin :0 auto;} <div id= ” wrapper ” ></div> ID
  • 11. CSS Selectors #content p {margin :0;} Compound : properties defined using multiple selector types.
  • 12. CSS Selectors #content p {margin :0;} <div id= ” content ” > <p>This is a paragraph of text in the content div.</p> </div> Compound
  • 13. CSS Box Model How do you position content? You position content in your page by using a combination of margins, padding and floats. But, in order to get your positioning and layout correct, you must know how the CSS Box Model works.
  • 14. CSS Box Model content
  • 15. CSS Box Model 40 px 10 px 100 px 450 px content
  • 16. CSS Box Model 10 px 1 px 50 px ??? px 500 px content
  • 17. CSS Box Model total box width = content area width + left padding + right padding + left border + right border + left margin + right margin
  • 18. CSS Box Model #content {width: 200px;border: 1px solid #900;padding: 10px;margin: 0;background: #fee;} What is the total box width?
  • 19. CSS Box Model #content {width: ???px;border: 1px solid #000;padding: 20px;margin: 10;} If the total box width is 400px, what is the width of the content area?