SlideShare a Scribd company logo
5
Most read
10
Most read
13
Most read
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

PDF
CSS Selectors
PPTX
Css box-model
PPT
5.1 css box model
PPSX
CSS Box Model Presentation
PPT
Box Model
ODP
Cascading Style Sheets - Part 02
PDF
Css introduction
PDF
Intro to CSS
CSS Selectors
Css box-model
5.1 css box model
CSS Box Model Presentation
Box Model
Cascading Style Sheets - Part 02
Css introduction
Intro to CSS

What's hot (17)

PPT
Html Expression Web
PPTX
Css ppt
PPTX
Css margins
PDF
CSS Box Model and Dimensions
PDF
The Dark Arts of CSS
PDF
PDF
Intro to HTML + CSS
PPTX
Web 102 INtro to CSS
PPTX
CSS Basics
PPTX
Cascading style sheets (CSS)
PPTX
Web Development Basics: HOW TO in HTML
PDF
Lab#7 CSS Box Model
PPTX
Css intro
PDF
Efficient, maintainable CSS
PPT
CSS Basics
Html Expression Web
Css ppt
Css margins
CSS Box Model and Dimensions
The Dark Arts of CSS
Intro to HTML + CSS
Web 102 INtro to CSS
CSS Basics
Cascading style sheets (CSS)
Web Development Basics: HOW TO in HTML
Lab#7 CSS Box Model
Css intro
Efficient, maintainable CSS
CSS Basics
Ad

Viewers also liked (20)

PDF
Css box model
PDF
CSS Box Model
PDF
CSS: selectors and the box model
PDF
CSS Layouting #3 : Box Model
PPTX
Cascading Style Sheets - CSS
PDF
CSS Selectors
PPTX
The Box Model [CSS Introduction]
PPTX
CSS Layout Techniques
PPTX
The CSS Box Model
PPT
Cascading Style Sheets(CSS)
PPT
PDF
Maintainable CSS
PPT
Css 2010
PPTX
KEY
Lecture3
PPTX
Introduction about wireframing and responsive webdesign
PPTX
Google's Principle's of Mobile Website Design
PDF
Next Steps in Responsive Design
KEY
Interactive Graphics using Javascript, HTML5 and CSS3
Css box model
CSS Box Model
CSS: selectors and the box model
CSS Layouting #3 : Box Model
Cascading Style Sheets - CSS
CSS Selectors
The Box Model [CSS Introduction]
CSS Layout Techniques
The CSS Box Model
Cascading Style Sheets(CSS)
Maintainable CSS
Css 2010
Lecture3
Introduction about wireframing and responsive webdesign
Google's Principle's of Mobile Website Design
Next Steps in Responsive Design
Interactive Graphics using Javascript, HTML5 and CSS3
Ad

Similar to CSS, CSS Selectors, CSS Box Model (20)

PPT
CSS for basic learner
PPT
PDF
CSS Foundations, pt 2
PPT
Basic css
PPTX
CHAPTER 3_ Getting Started with CSS Module
PPTX
Web topic 15 1 basic css layout
PPTX
PPTX
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
PDF
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
ODP
Css.prabu
PPTX
Web programming css
PPTX
What is css
PPTX
Cascading style sheets (CSS-Web Technology)
PDF
GDI Seattle Intro to HTML and CSS - Class 3
PPTX
Class andid
PPTX
Cordova training - Day 2 Introduction to CSS 3
PPT
Cascading Style Sheets
PPTX
Cascading Style sheet by Vishal Gour Guest Faculty CSE AUS
PPTX
CSS Topic wise Short notes ppt by Navya.E
CSS for basic learner
CSS Foundations, pt 2
Basic css
CHAPTER 3_ Getting Started with CSS Module
Web topic 15 1 basic css layout
UNIT 3WOP fgfufhbuiibpvihbvpihivbhibvipuuvbiuvboi
CascadingStyleSheets in ONESHOT By DeathCodeYT .pdf
Css.prabu
Web programming css
What is css
Cascading style sheets (CSS-Web Technology)
GDI Seattle Intro to HTML and CSS - Class 3
Class andid
Cordova training - Day 2 Introduction to CSS 3
Cascading Style Sheets
Cascading Style sheet by Vishal Gour Guest Faculty CSE AUS
CSS Topic wise Short notes ppt by Navya.E

More from jamiecavanaugh (6)

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

Recently uploaded (20)

PPTX
Congenital Hypothyroidism pptx
PPTX
Introduction and Scope of Bichemistry.pptx
PPTX
Software Engineering BSC DS UNIT 1 .pptx
PDF
LDMMIA Reiki Yoga S2 L3 Vod Sample Preview
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
PDF
Sunset Boulevard Student Revision Booklet
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
What Is Coercive Control? Understanding and Recognizing Hidden Abuse
PPTX
How to Manage Global Discount in Odoo 18 POS
PPTX
IMMUNIZATION PROGRAMME pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
High Ground Student Revision Booklet Preview
PDF
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
Congenital Hypothyroidism pptx
Introduction and Scope of Bichemistry.pptx
Software Engineering BSC DS UNIT 1 .pptx
LDMMIA Reiki Yoga S2 L3 Vod Sample Preview
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
How to Manage Starshipit in Odoo 18 - Odoo Slides
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
Sunset Boulevard Student Revision Booklet
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
What Is Coercive Control? Understanding and Recognizing Hidden Abuse
How to Manage Global Discount in Odoo 18 POS
IMMUNIZATION PROGRAMME pptx
Week 4 Term 3 Study Techniques revisited.pptx
LDMMIA Reiki Yoga Workshop 15 MidTerm Review
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Renaissance Architecture: A Journey from Faith to Humanism
High Ground Student Revision Booklet Preview
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf

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?