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

Css ppt
Css pptCss ppt
Css ppt
Nidhi mishra
 
Css margins
Css marginsCss margins
Css margins
Webtech Learning
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and DimensionsGerson Abesamis
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
SiddharthBorderwala
 
Sass
SassSass
Intro to HTML + CSS
Intro to HTML + CSSIntro to HTML + CSS
Intro to HTML + CSS
Jamal Sinclair O'Garro
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
Hawkman Academy
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Nitin Bhide
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
Harshita Yadav
 
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
Der Lo
 
Lab#7 CSS Box Model
Lab#7 CSS Box ModelLab#7 CSS Box Model
Lab#7 CSS Box Model
Yaowaluck Promdee
 
Css intro
Css introCss intro
Css intro
Julia Vi
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSS
Russ Weakley
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 

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

CSS: selectors and the box model
CSS: selectors and the box modelCSS: selectors and the box model
CSS: selectors and the box modelIdan Gazit
 
CSS Layouting #3 : Box Model
CSS Layouting #3 : Box ModelCSS Layouting #3 : Box Model
CSS Layouting #3 : Box Model
Sandhika Galih
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
Sun Technlogies
 
CSS Selectors
CSS SelectorsCSS Selectors
CSS Selectors
Rachel Andrew
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
Nicole Ryan
 
CSS Layout Techniques
CSS Layout TechniquesCSS Layout Techniques
CSS Layout Techniques
Harshal Patil
 
The CSS Box Model
The CSS Box ModelThe CSS Box Model
The CSS Box Model
Graeme Smith
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
Reshmi Rajan
 
Simplifying CSS Selectors
Simplifying CSS SelectorsSimplifying CSS Selectors
Simplifying CSS Selectors
Baris Aydinoglu
 
Maintainable CSS
Maintainable CSSMaintainable CSS
Maintainable CSS
Stephen Hay
 
HTML5 Quick Start
HTML5 Quick StartHTML5 Quick Start
Postman
PostmanPostman
Introduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignIntroduction about wireframing and responsive webdesign
Introduction about wireframing and responsive webdesignipmindthegap
 
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
Mrkt360 Inc.
 
Next Steps in Responsive Design
Next Steps in Responsive DesignNext Steps in Responsive Design
Next Steps in Responsive Design
Justin Avery
 

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

CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2Shawn Calvert
 
Iml140 cs sbasics_week5
Iml140 cs sbasics_week5Iml140 cs sbasics_week5
Iml140 cs sbasics_week5
Evan Hughes
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
Shawn Calvert
 
Css
CssCss
Rational HATS and CSS
Rational HATS and CSSRational HATS and CSS
Rational HATS and CSS
Strongback Consulting
 
Introducing CSS Selectors.docx
Introducing CSS Selectors.docxIntroducing CSS Selectors.docx
Introducing CSS Selectors.docx
Dr. Somnath Sinha
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
Yoeung Vibol
 
Class andid
Class andidClass andid
Class andidjovy_75
 
CSS For Coders
CSS For CodersCSS For Coders
CSS For Coders
ggfergu
 
Advanced Cascading Style Sheets
Advanced Cascading Style SheetsAdvanced Cascading Style Sheets
Advanced Cascading Style Sheets
fantasticdigitaltools
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
TusharTikia
 
Css.html
Css.htmlCss.html
css.ppt
css.pptcss.ppt
css.ppt
bhasula
 
Css basics
Css basicsCss basics
Css basics
ASIT
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
Shawn Calvert
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
Knoldus Inc.
 
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
kassahungebrie
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
Programmer Blog
 

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 Opportunities
jamiecavanaugh
 
IxD Information Session
IxD Information SessionIxD Information Session
IxD Information Session
jamiecavanaugh
 
Wireframing
WireframingWireframing
Wireframing
jamiecavanaugh
 
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 touch
jamiecavanaugh
 

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

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

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?