SlideShare a Scribd company logo
1 of 55
WORKING WITH
THE BOX MODEL
Lesson 5
2 SELERTOR
CLASSIFICATION
GROUPING SELECTOR
• The CSS grouping selector is used to select
multiple elements and style them together.
This reduces the code and extra effort to
declare common styles for each element. To
group selectors, each selector is separated
by a space.
EXAMPLE:
<!DOCTYPE
html>
<html>
<head>
<style>
article, p, img {
display: block;
margin: auto;
text-align: center;
border-bottom: double orange;
}
</style>
</head><body>
<article>Demo Text</article>
<p>This is demo text.</p>
<br/>
<img
src="https://www.tutorialspoint.com/swi
ng/images/swing.jpg">
</body>
</html>
RESULT:
CLASIFYING SECTOR
• The class selector selects HTML elements
with a specific class attribute. To select
elements with a specific class, write a
period (.) character, followed by the class
name
EXAMPLE:
LAYOUT TABLE:
• A layout table is a table used to provide some
sort of visual structure to a page, sometimes
people want to design columns on a page, some
people find using layout tables easier for Forms,
etc. When you use a table for anything but
providing data, you are using a table for layout.
RESULT:
CSS POSITIONING
The position CSS property sets
how an element is positioned
in a document.
The top, right, bottom,
and left properties determine
the final location of positioned
elements.
CSS
POSITIONING
PPROPERTIES
STATIC:
The default position.
The element would be
in this position if you
did not specify any
value.
• Static is the default position for
HTML elements. Elements
with position: static are positioned
based on the normal flow of the page,
as you would expect them to be
without any CSS styling. They are not
affected by the top, right, bottom, or
left properties.
STATIC EXAMPLE:
RELATIVE:
•This position depends on the
other element. Even if you
resize the browser window, it
will not overlap into other
element (unlike the absolute
value).
•you set values for
the top, right, bottom,
and/or left properties.
Surrounding elements won’t be
affected, but there will be space
where the repositioned element
would have been (in static
positioning).
RELATIVE EXAMPLE:
ABSOLUTE:
The element stays in one place if
you resize the browser window, it
will remain in the part of the page
you assigned.
an element ignores the normal
document flow
ABSOLUTE EXAMPLE:
div 2 is placed inside a container div (in gray) and
positioned relative to the container, since the
container is the nearest ancestor element of div 2.
FIXED:
•The elements stays in place
even if you scroll up or down,
left or right . Its positions
depends on the browser
window not on the page itself.
FIXED EXAMPLE
FLOAT:
The float CSS property places an
element on the left or right side of its
container, allowing text and inline
elements to wrap around it.
EXAMPLE:
CLEAR:
Ensures that there is no content
around the element.
SPAN AND DIV
SPAN
•The span element is a generic
inline element, typically used to
apply styling to a portion of inline
content. An inline element does
not start a new line and only takes
up as much space on the page as
its content.
•Span used to change the
color of the text
•Span also use in
changing the aspects of a
text.
DIV
•The div (division) element is a
generic block-level element, most
often used to divide page content
into blocks. A block element is a
page element that starts a new
line and has a width equal to the
entire page or the parent
container.
div element use to
separate contents
of a page into
chunks.
DIFFERENCE BETWEEN SPAN
AND DIV
•A div element is used for block-
level organization and styling
of page elements, whereas a
span element is used for inline
organization and styling.
•To summarize, a div tag
creates a block-level
element while a <span>
tag wraps around an inline
element.
THE BOX MODEL
The term "box model" is used when
talking about design and layout.
Explanation of the different parts:
• Content / element- The content of the box, where
text and images appear
• Padding - Clears an area around the content. The
padding is transparent
• Border - A border that goes around the padding
and content
• Margin - Clears an area outside the border. The
margin is transparent
MARGIN and PADDING
The margin property sets the margins
for an element, and is a shorthand
property for the following properties:
•margin-top
•margin-right
•margin-bottom
•margin-left
•a margin is the
area between the
main content of a
page and the
page edges
PADDING PROPERTY
The padding property in CSS defines the innermost
portion of the box model, creating space around an
element’s content, inside of any defined margins
and/or borders.
Padding values are set using lengths or
percentages, and cannot accept negative values.
The initial, or default, value for all padding properties
is 0.
three values are declared, it is padding: [top] [left-
and-right] [bottom];.
•Padding represents the amount
of inner space an element has,
while the margin is whitespace
available surrounding an
element.
END OF LESSON 5

More Related Content

Similar to Working-With-The-Box-Model-Lesson-5.pptx

Fundamentals of Browser Rendering Css Overview PT 1
Fundamentals of Browser Rendering Css Overview PT 1Fundamentals of Browser Rendering Css Overview PT 1
Fundamentals of Browser Rendering Css Overview PT 1Barak Drechsler
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdfAAFREEN SHAIKH
 
Style With Kyle - Kyle Smith
Style With Kyle - Kyle SmithStyle With Kyle - Kyle Smith
Style With Kyle - Kyle Smithwcfay
 
Designing for the web - 101
Designing for the web - 101Designing for the web - 101
Designing for the web - 101Ashraf Hamdy
 
Quarter 3_Lesson_One_CSSheets_Paddings.pdf
Quarter 3_Lesson_One_CSSheets_Paddings.pdfQuarter 3_Lesson_One_CSSheets_Paddings.pdf
Quarter 3_Lesson_One_CSSheets_Paddings.pdfRobilynBPataras
 
Introduction to Frontend Development - Session 2 - CSS Fundamentals
Introduction to Frontend Development - Session 2 - CSS FundamentalsIntroduction to Frontend Development - Session 2 - CSS Fundamentals
Introduction to Frontend Development - Session 2 - CSS FundamentalsKalin Chernev
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1jeweltutin
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraftimrokraft
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layoutCK Yang
 
Creative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS BasicsCreative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS BasicsLukas Oppermann
 

Similar to Working-With-The-Box-Model-Lesson-5.pptx (20)

Fundamentals of Browser Rendering Css Overview PT 1
Fundamentals of Browser Rendering Css Overview PT 1Fundamentals of Browser Rendering Css Overview PT 1
Fundamentals of Browser Rendering Css Overview PT 1
 
css3.pptx
css3.pptxcss3.pptx
css3.pptx
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
CSS
CSSCSS
CSS
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf
 
Fewd week2 slides
Fewd week2 slidesFewd week2 slides
Fewd week2 slides
 
Style With Kyle - Kyle Smith
Style With Kyle - Kyle SmithStyle With Kyle - Kyle Smith
Style With Kyle - Kyle Smith
 
Designing for the web - 101
Designing for the web - 101Designing for the web - 101
Designing for the web - 101
 
Quarter 3_Lesson_One_CSSheets_Paddings.pdf
Quarter 3_Lesson_One_CSSheets_Paddings.pdfQuarter 3_Lesson_One_CSSheets_Paddings.pdf
Quarter 3_Lesson_One_CSSheets_Paddings.pdf
 
Css
CssCss
Css
 
Introduction to Frontend Development - Session 2 - CSS Fundamentals
Introduction to Frontend Development - Session 2 - CSS FundamentalsIntroduction to Frontend Development - Session 2 - CSS Fundamentals
Introduction to Frontend Development - Session 2 - CSS Fundamentals
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1
 
CSS Basics part One
CSS Basics part OneCSS Basics part One
CSS Basics part One
 
CSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - ImrokraftCSS3 basics for beginners - Imrokraft
CSS3 basics for beginners - Imrokraft
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
 
Creative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS BasicsCreative Web 02 - HTML & CSS Basics
Creative Web 02 - HTML & CSS Basics
 
CSS
CSSCSS
CSS
 
ppt.ppt
ppt.pptppt.ppt
ppt.ppt
 
WT CSS
WT  CSSWT  CSS
WT CSS
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Working-With-The-Box-Model-Lesson-5.pptx

  • 1. WORKING WITH THE BOX MODEL Lesson 5
  • 3. GROUPING SELECTOR • The CSS grouping selector is used to select multiple elements and style them together. This reduces the code and extra effort to declare common styles for each element. To group selectors, each selector is separated by a space.
  • 4.
  • 5.
  • 6. EXAMPLE: <!DOCTYPE html> <html> <head> <style> article, p, img { display: block; margin: auto; text-align: center; border-bottom: double orange; } </style> </head><body> <article>Demo Text</article> <p>This is demo text.</p> <br/> <img src="https://www.tutorialspoint.com/swi ng/images/swing.jpg"> </body> </html>
  • 8. CLASIFYING SECTOR • The class selector selects HTML elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the class name
  • 9.
  • 11. LAYOUT TABLE: • A layout table is a table used to provide some sort of visual structure to a page, sometimes people want to design columns on a page, some people find using layout tables easier for Forms, etc. When you use a table for anything but providing data, you are using a table for layout.
  • 12.
  • 13.
  • 14.
  • 16.
  • 17. CSS POSITIONING The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.
  • 19. STATIC: The default position. The element would be in this position if you did not specify any value.
  • 20. • Static is the default position for HTML elements. Elements with position: static are positioned based on the normal flow of the page, as you would expect them to be without any CSS styling. They are not affected by the top, right, bottom, or left properties.
  • 22.
  • 23. RELATIVE: •This position depends on the other element. Even if you resize the browser window, it will not overlap into other element (unlike the absolute value).
  • 24. •you set values for the top, right, bottom, and/or left properties. Surrounding elements won’t be affected, but there will be space where the repositioned element would have been (in static positioning).
  • 26.
  • 27. ABSOLUTE: The element stays in one place if you resize the browser window, it will remain in the part of the page you assigned. an element ignores the normal document flow
  • 29. div 2 is placed inside a container div (in gray) and positioned relative to the container, since the container is the nearest ancestor element of div 2.
  • 30. FIXED: •The elements stays in place even if you scroll up or down, left or right . Its positions depends on the browser window not on the page itself.
  • 32.
  • 33. FLOAT: The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it.
  • 35. CLEAR: Ensures that there is no content around the element.
  • 37. SPAN •The span element is a generic inline element, typically used to apply styling to a portion of inline content. An inline element does not start a new line and only takes up as much space on the page as its content.
  • 38. •Span used to change the color of the text •Span also use in changing the aspects of a text.
  • 39. DIV •The div (division) element is a generic block-level element, most often used to divide page content into blocks. A block element is a page element that starts a new line and has a width equal to the entire page or the parent container.
  • 40. div element use to separate contents of a page into chunks.
  • 41. DIFFERENCE BETWEEN SPAN AND DIV •A div element is used for block- level organization and styling of page elements, whereas a span element is used for inline organization and styling.
  • 42. •To summarize, a div tag creates a block-level element while a <span> tag wraps around an inline element.
  • 43. THE BOX MODEL The term "box model" is used when talking about design and layout.
  • 44.
  • 45. Explanation of the different parts: • Content / element- The content of the box, where text and images appear • Padding - Clears an area around the content. The padding is transparent • Border - A border that goes around the padding and content • Margin - Clears an area outside the border. The margin is transparent
  • 46.
  • 47.
  • 48. MARGIN and PADDING The margin property sets the margins for an element, and is a shorthand property for the following properties: •margin-top •margin-right •margin-bottom •margin-left
  • 49. •a margin is the area between the main content of a page and the page edges
  • 50.
  • 51.
  • 52. PADDING PROPERTY The padding property in CSS defines the innermost portion of the box model, creating space around an element’s content, inside of any defined margins and/or borders. Padding values are set using lengths or percentages, and cannot accept negative values. The initial, or default, value for all padding properties is 0. three values are declared, it is padding: [top] [left- and-right] [bottom];.
  • 53.
  • 54. •Padding represents the amount of inner space an element has, while the margin is whitespace available surrounding an element.