SlideShare a Scribd company logo
Box Model
 The three most commonly used CSS box properties are:
 padding
 border
 margin
 The other two properties are:
 width
 length
 Padding is the internal white space that surrounds the contents of
an element.
 The padding properties control this internal white space.
 By default, the content of an element does not have padding.
 All major Web browsers add varying amounts of padding by
default.
 To set the padding within an element, use:
 padding: width;
 To set the padding for each side individually, the following four
properties can be used:
 padding-top
 padding-right
 padding-bottom
 padding-left
 The shorthand property can be used:
 padding: top right bottom left;
 Values for both the padding and the margin properties can be
expressed using:
 em (em values)
 px (pixels)
 mm (millimeters)
 cm (centimeters)
 in (inches)
 % (percentage of the container element)
 The margin properties control the external white space, which is
the white space outside the border.
 Every element has margins.
 The margin properties are often used to create a white space
around images.
 To set the margin space around an element, use:
 margin: width;
 To set the padding for each side individually, the following four
properties can be used:
 margin-top
 margin-right
 margin-bottom
 margin-left
 The shorthand property can be used:
 margin: top right bottom left;
 The border properties are used to place a decorative border
around the contents and padding of an element.
 The border is located between the padding and the margin.
 You can change a border’s:
 style
 color
 width
 The border-style value can be any one of the following:
– solid – double – dotted
– dashed – groove – ridge
– inset – outset – none (default)
 There are five border-style properties:
 border-top-style
 border-right-style
 border-bottom-style
 border-left-style
 border-style (shorthand property)
 Border thickness can be expressed using the keywords:
– thin
– medium
– thick
 There are five
border-width properties:
 border-top-width
 border-right-width
 border-bottom-width
 border-left-width
 border-width (shorthand property)
 The border color can be a named color, a hex value, or an RGB value.
 There are five border-color properties:
 border-top-color
 border-right-color
 border-bottom-color
 border-left-color
 border-color (shorthand property)
The following three properties change the border
style, width, or color for all four borders:
 border-color
 border-style
 border-width
The following four properties change the border
style, width, or color for an individual border:
 border-top
 border-right
 border-bottom
 border-left
To shorten the code, it is also possible to specify all
the individual border properties in one property.
The border property is a shorthand property for the
following individual border properties:
 border-width
 border-style (required)
 border-color
 Example
p {
border: 5px solid khaki;
}
h3 {
border-bottom: thick solid darkkhaki;
padding-bottom: 0.5em;
}
 The float property is used to position boxes on the page and to
wrap content, such as text, around a box.
 To float an element, use the style:
float: position;
 The position can have the following values:
 left
 right
 none
 The clear property is used to position the content of an element
below another element that has been floated.
 This is also called clearing past an element.
 To clear past an element, use the style:
clear: position;
 The position can have the following values:
 left
 right
 both
 The background properties set the background effects for an element.
 The following properties can be used:
- background-image - background-color
- background-position - background-repeat
- background-attachment - background
 For the last one, values must be listed in the following order:
image color position repeat attachment
 The background-image property is used to fill the background of an
element with an image.
 If this property is used with the body element as a selector, and if the
image is repeated both horizontally and vertically (the default), then
the background image will repeat to occupy the entire Web page.
 The background-position property allows you to position a
background image in different locations within its container element.
 The container element could be body, head, or footer.
 The background-repeat property can be used to have copies
of an image appear behind an element horizontally, vertically, or
both.
 Repeating an image is known as tiling.
 The background-attachment property allows you to set the
behavior of the background image with respect to scrolling.
 This property accepts two values:
 scroll (the default value) – image scrolls down the page
 fixed – image stays in place and the text scrolls over the image as
the user scrolls down the page
 The term cascading in CSS refers to the methods used to
determine which style rules apply if more than one rule styles the
same element.
 Style precedence determines which styles have priority.
 There are five possible sources for styles.
 The order of precedence (from highest precedence to lowest) is
as follows:
1. User-defined styles
2. Inline styles
3. Embedded style sheet styles
4. External style sheet styles
5. The browser’s style sheet (the browser’s default styles)

More Related Content

Similar to CSS Box Model

Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
Steve Guinan
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
Himanshu Pathak
 
CSS3: Background And DropShadows:
CSS3: Background And DropShadows:CSS3: Background And DropShadows:
CSS3: Background And DropShadows:
Reema
 
CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
NavyaEnugala
 
css3.pptx
css3.pptxcss3.pptx
css3.pptx
ThiyaguPappu
 
CSS3 Backgrounds
CSS3 BackgroundsCSS3 Backgrounds
CSS3 Backgrounds
Russ Weakley
 
Art of css
Art of cssArt of css
Art of css
Raphael Wanjiku
 
Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4
Naresh Sharma
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
Timbal Mayank
 
Border
BorderBorder
Border
Ankit Dubey
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
Nosheen Qamar
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
Adeel Rasheed
 
basics of css
basics of cssbasics of css
basics of css
Priya Goyal
 
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
Gheyath M. Othman
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
kushwahanitesh592
 
Chapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSSChapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSS
Dr. Ahmed Al Zaidy
 
Css
CssCss

Similar to CSS Box Model (20)

Chapter 14: Box Model
Chapter 14: Box ModelChapter 14: Box Model
Chapter 14: Box Model
 
Cascading style sheet part 2
Cascading style sheet   part 2Cascading style sheet   part 2
Cascading style sheet part 2
 
CSS3: Background And DropShadows:
CSS3: Background And DropShadows:CSS3: Background And DropShadows:
CSS3: Background And DropShadows:
 
Css
CssCss
Css
 
CSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.ECSS Topic wise Short notes ppt by Navya.E
CSS Topic wise Short notes ppt by Navya.E
 
css3.pptx
css3.pptxcss3.pptx
css3.pptx
 
CSS3 Backgrounds
CSS3 BackgroundsCSS3 Backgrounds
CSS3 Backgrounds
 
Art of css
Art of cssArt of css
Art of css
 
Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4Introduction to CSS Borders - Lesson 4
Introduction to CSS Borders - Lesson 4
 
Css outlines
Css outlinesCss outlines
Css outlines
 
Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)Cascading style sheets (CSS-Web Technology)
Cascading style sheets (CSS-Web Technology)
 
Border
BorderBorder
Border
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
CSS Cascade Style Sheet
CSS Cascade Style SheetCSS Cascade Style Sheet
CSS Cascade Style Sheet
 
basics of css
basics of cssbasics of css
basics of css
 
Dimensions of elements.pdf
Dimensions of elements.pdfDimensions of elements.pdf
Dimensions of elements.pdf
 
Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
Unit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptxUnit - 3 CSS(Cascading Style Sheet).pptx
Unit - 3 CSS(Cascading Style Sheet).pptx
 
Chapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSSChapter 4 Graphic Design with CSS
Chapter 4 Graphic Design with CSS
 
Css
CssCss
Css
 

More from kjkleindorfer

Logic and Coding of Java Interfaces & Swing Applications
Logic and Coding of Java Interfaces & Swing ApplicationsLogic and Coding of Java Interfaces & Swing Applications
Logic and Coding of Java Interfaces & Swing Applications
kjkleindorfer
 
Week11 Inheritance class relationships in Java
Week11 Inheritance class relationships in JavaWeek11 Inheritance class relationships in Java
Week11 Inheritance class relationships in Java
kjkleindorfer
 
Week10 packages using objects in objects
Week10 packages using objects in objectsWeek10 packages using objects in objects
Week10 packages using objects in objects
kjkleindorfer
 
Week9 Intro to classes and objects in Java
Week9 Intro to classes and objects in JavaWeek9 Intro to classes and objects in Java
Week9 Intro to classes and objects in Java
kjkleindorfer
 
Intro to Bootstrap
Intro to BootstrapIntro to Bootstrap
Intro to Bootstrap
kjkleindorfer
 
Layouts Part 2
Layouts Part 2Layouts Part 2
Layouts Part 2
kjkleindorfer
 
Layouts
Layouts Layouts
Layouts
kjkleindorfer
 
Using PHP to submit forms
Using PHP to submit formsUsing PHP to submit forms
Using PHP to submit forms
kjkleindorfer
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
kjkleindorfer
 
CSS Selectors and Fonts
CSS Selectors and FontsCSS Selectors and Fonts
CSS Selectors and Fonts
kjkleindorfer
 

More from kjkleindorfer (10)

Logic and Coding of Java Interfaces & Swing Applications
Logic and Coding of Java Interfaces & Swing ApplicationsLogic and Coding of Java Interfaces & Swing Applications
Logic and Coding of Java Interfaces & Swing Applications
 
Week11 Inheritance class relationships in Java
Week11 Inheritance class relationships in JavaWeek11 Inheritance class relationships in Java
Week11 Inheritance class relationships in Java
 
Week10 packages using objects in objects
Week10 packages using objects in objectsWeek10 packages using objects in objects
Week10 packages using objects in objects
 
Week9 Intro to classes and objects in Java
Week9 Intro to classes and objects in JavaWeek9 Intro to classes and objects in Java
Week9 Intro to classes and objects in Java
 
Intro to Bootstrap
Intro to BootstrapIntro to Bootstrap
Intro to Bootstrap
 
Layouts Part 2
Layouts Part 2Layouts Part 2
Layouts Part 2
 
Layouts
Layouts Layouts
Layouts
 
Using PHP to submit forms
Using PHP to submit formsUsing PHP to submit forms
Using PHP to submit forms
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
 
CSS Selectors and Fonts
CSS Selectors and FontsCSS Selectors and Fonts
CSS Selectors and Fonts
 

Recently uploaded

"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
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
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
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
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
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
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
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
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
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 

Recently uploaded (20)

"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...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
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
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
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
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
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
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
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
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 

CSS Box Model

  • 2.
  • 3.  The three most commonly used CSS box properties are:  padding  border  margin  The other two properties are:  width  length
  • 4.  Padding is the internal white space that surrounds the contents of an element.  The padding properties control this internal white space.  By default, the content of an element does not have padding.  All major Web browsers add varying amounts of padding by default.
  • 5.  To set the padding within an element, use:  padding: width;  To set the padding for each side individually, the following four properties can be used:  padding-top  padding-right  padding-bottom  padding-left  The shorthand property can be used:  padding: top right bottom left;
  • 6.  Values for both the padding and the margin properties can be expressed using:  em (em values)  px (pixels)  mm (millimeters)  cm (centimeters)  in (inches)  % (percentage of the container element)
  • 7.  The margin properties control the external white space, which is the white space outside the border.  Every element has margins.  The margin properties are often used to create a white space around images.
  • 8.  To set the margin space around an element, use:  margin: width;  To set the padding for each side individually, the following four properties can be used:  margin-top  margin-right  margin-bottom  margin-left  The shorthand property can be used:  margin: top right bottom left;
  • 9.
  • 10.
  • 11.  The border properties are used to place a decorative border around the contents and padding of an element.  The border is located between the padding and the margin.  You can change a border’s:  style  color  width
  • 12.  The border-style value can be any one of the following: – solid – double – dotted – dashed – groove – ridge – inset – outset – none (default)  There are five border-style properties:  border-top-style  border-right-style  border-bottom-style  border-left-style  border-style (shorthand property)
  • 13.  Border thickness can be expressed using the keywords: – thin – medium – thick  There are five border-width properties:  border-top-width  border-right-width  border-bottom-width  border-left-width  border-width (shorthand property)
  • 14.  The border color can be a named color, a hex value, or an RGB value.  There are five border-color properties:  border-top-color  border-right-color  border-bottom-color  border-left-color  border-color (shorthand property)
  • 15. The following three properties change the border style, width, or color for all four borders:  border-color  border-style  border-width The following four properties change the border style, width, or color for an individual border:  border-top  border-right  border-bottom  border-left
  • 16. To shorten the code, it is also possible to specify all the individual border properties in one property. The border property is a shorthand property for the following individual border properties:  border-width  border-style (required)  border-color  Example p { border: 5px solid khaki; }
  • 17. h3 { border-bottom: thick solid darkkhaki; padding-bottom: 0.5em; }
  • 18.  The float property is used to position boxes on the page and to wrap content, such as text, around a box.  To float an element, use the style: float: position;  The position can have the following values:  left  right  none
  • 19.
  • 20.  The clear property is used to position the content of an element below another element that has been floated.  This is also called clearing past an element.  To clear past an element, use the style: clear: position;  The position can have the following values:  left  right  both
  • 21.
  • 22.  The background properties set the background effects for an element.  The following properties can be used: - background-image - background-color - background-position - background-repeat - background-attachment - background  For the last one, values must be listed in the following order: image color position repeat attachment
  • 23.  The background-image property is used to fill the background of an element with an image.  If this property is used with the body element as a selector, and if the image is repeated both horizontally and vertically (the default), then the background image will repeat to occupy the entire Web page.
  • 24.  The background-position property allows you to position a background image in different locations within its container element.  The container element could be body, head, or footer.
  • 25.  The background-repeat property can be used to have copies of an image appear behind an element horizontally, vertically, or both.  Repeating an image is known as tiling.
  • 26.  The background-attachment property allows you to set the behavior of the background image with respect to scrolling.  This property accepts two values:  scroll (the default value) – image scrolls down the page  fixed – image stays in place and the text scrolls over the image as the user scrolls down the page
  • 27.
  • 28.
  • 29.
  • 30.  The term cascading in CSS refers to the methods used to determine which style rules apply if more than one rule styles the same element.  Style precedence determines which styles have priority.  There are five possible sources for styles.
  • 31.  The order of precedence (from highest precedence to lowest) is as follows: 1. User-defined styles 2. Inline styles 3. Embedded style sheet styles 4. External style sheet styles 5. The browser’s style sheet (the browser’s default styles)