SlideShare a Scribd company logo
1 of 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?

More Related Content

What's hot (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
 

Viewers also liked (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
 

Similar to CSS, CSS Selectors, CSS Box Model

Similar to 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
 

More from jamiecavanaugh

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

More from 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
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

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?