SlideShare uma empresa Scribd logo
1 de 36
CSS Floats & Positioning Colin Gourlay & Kevin Vanderbeken
Today: Floating Elements Clearing Floated Elements
introduction
different boxes
block elements <div>, <p>, etc. I’m text inside a block element So am I. I’m in a block element too!
inline elements <span>, <a>, etc. I’m text inside an inline element So am I. I’m in an inline element too!
block and inline elements support the box model in different ways
[object Object]
Margins are only possible on the left and right, not top and bottom.
...and other things left to your experimentation :-) ,[object Object]
When the window or containing element is resized, block elements expand or contract to the new width. block element block element block element block element block element block element
When the window or containing element is resized, inline elements reflow to fit.  inline element inline inline element element inline element inline element inline element
elements don’t overlap or bunch up, they make room for one another
floated elements a.k.a ‘floats’
floats can be used to create: multi-column layouts navigation toolbars table-like alignment (without tables) and much, much moreTM
float: left; float: right; float: none;
things you should know about floated elements
a floated element is like an island in a stream I’m a block element that is beside an image that has been floated to the right. My contents will wrap around the image.
floats stay in the content area of the containing element this isn’t possible
margins are maintained img{ float: right; margin-left: 5px; margin-right: 5px; } I’m a block element that is beside an image that has been floated to the right. My contents will wrap around the image.
always provide a width for floated elements p.floatRight{ float: right; margin: 5px; width: 120px; } I’m a block element that is beside an paragraph that has been floated to the right. My contents  I’m a paragraph element, floated to the right, with a defined width will wrap around the paragraph.
floated inline elements behave as block elements
elements do not float higher than their reference in the source
you can float multiple elements Because I am beside two floated elements (one left, one right), I wrap around both of them.
there is one noticeable side effect of using floats...
what we actually want to see is this...
to achieve this effect, we need to make use of clearing
clearing floated elements
clear: left; clear: right; clear: both;
clear: left; The left value starts the element below any elements that have been floated to the left
clear: right; Similarly, the right value makes the element clear all floats on the right edge of the containing block
clear: both;  If there are multiple floated elements, and you want to be sure an element starts below all of them, use the both value to clear floats on both sides
My position is governed by the floated elements to the left. I have not been cleared in any way. I have been cleared, so I start below the floated elements.
next week...

Mais conteúdo relacionado

Semelhante a 1 07-2-css floats-and_positioning

Semelhante a 1 07-2-css floats-and_positioning (20)

Chapter05-Presentation.pptx
Chapter05-Presentation.pptxChapter05-Presentation.pptx
Chapter05-Presentation.pptx
 
CSS_Dibbo
CSS_DibboCSS_Dibbo
CSS_Dibbo
 
Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11
 
CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)CSS_Day_Three (W3schools)
CSS_Day_Three (W3schools)
 
Web Design & Development - Session 3
Web Design & Development - Session 3Web Design & Development - Session 3
Web Design & Development - Session 3
 
Css training
Css trainingCss training
Css training
 
Floats
FloatsFloats
Floats
 
HTML Block and Inline Elements
HTML Block and Inline ElementsHTML Block and Inline Elements
HTML Block and Inline Elements
 
WEBD 162: display property, Float and Clear
WEBD 162: display property, Float and ClearWEBD 162: display property, Float and Clear
WEBD 162: display property, Float and Clear
 
CSS Layout
CSS LayoutCSS Layout
CSS Layout
 
Designing for the web - 101
Designing for the web - 101Designing for the web - 101
Designing for the web - 101
 
Ans.1 There are four different position values •static •relat.pdf
Ans.1 There are four different position values •static •relat.pdfAns.1 There are four different position values •static •relat.pdf
Ans.1 There are four different position values •static •relat.pdf
 
Css layout
Css layoutCss layout
Css layout
 
Css 101
Css 101Css 101
Css 101
 
CSS3 Refresher
CSS3 RefresherCSS3 Refresher
CSS3 Refresher
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Art of css
Art of cssArt of css
Art of css
 
Lecture2 CSS 3
Lecture2   CSS 3Lecture2   CSS 3
Lecture2 CSS 3
 
CSS tutorial chapter 3
CSS tutorial chapter 3CSS tutorial chapter 3
CSS tutorial chapter 3
 
WDES106 CSS Advanced Part 1
WDES106 CSS Advanced Part 1WDES106 CSS Advanced Part 1
WDES106 CSS Advanced Part 1
 

Mais de apnwebdev

1 07-the box-model
1 07-the box-model1 07-the box-model
1 07-the box-modelapnwebdev
 
1 06-more html-elements
1 06-more html-elements1 06-more html-elements
1 06-more html-elementsapnwebdev
 
1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgroundsapnwebdev
 
1 04-html elements
1 04-html elements1 04-html elements
1 04-html elementsapnwebdev
 
1-07: The Box Model
1-07: The Box Model1-07: The Box Model
1-07: The Box Modelapnwebdev
 
1-06: More HTML Elements
1-06: More HTML Elements1-06: More HTML Elements
1-06: More HTML Elementsapnwebdev
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgroundsapnwebdev
 
1-04: HTML Elements
1-04: HTML Elements1-04: HTML Elements
1-04: HTML Elementsapnwebdev
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
 
1-02: HTML Markup Introduction
1-02: HTML Markup Introduction1-02: HTML Markup Introduction
1-02: HTML Markup Introductionapnwebdev
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Developmentapnwebdev
 

Mais de apnwebdev (11)

1 07-the box-model
1 07-the box-model1 07-the box-model
1 07-the box-model
 
1 06-more html-elements
1 06-more html-elements1 06-more html-elements
1 06-more html-elements
 
1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds1 05-css for-text_and_backgrounds
1 05-css for-text_and_backgrounds
 
1 04-html elements
1 04-html elements1 04-html elements
1 04-html elements
 
1-07: The Box Model
1-07: The Box Model1-07: The Box Model
1-07: The Box Model
 
1-06: More HTML Elements
1-06: More HTML Elements1-06: More HTML Elements
1-06: More HTML Elements
 
1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds1-05: CSS for Text and Backgrounds
1-05: CSS for Text and Backgrounds
 
1-04: HTML Elements
1-04: HTML Elements1-04: HTML Elements
1-04: HTML Elements
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
1-02: HTML Markup Introduction
1-02: HTML Markup Introduction1-02: HTML Markup Introduction
1-02: HTML Markup Introduction
 
1-01: Introduction To Web Development
1-01: Introduction To  Web  Development1-01: Introduction To  Web  Development
1-01: Introduction To Web Development
 

Último

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Último (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

1 07-2-css floats-and_positioning

  • 1. CSS Floats & Positioning Colin Gourlay & Kevin Vanderbeken
  • 2. Today: Floating Elements Clearing Floated Elements
  • 5. block elements <div>, <p>, etc. I’m text inside a block element So am I. I’m in a block element too!
  • 6. inline elements <span>, <a>, etc. I’m text inside an inline element So am I. I’m in an inline element too!
  • 7. block and inline elements support the box model in different ways
  • 8.
  • 9. Margins are only possible on the left and right, not top and bottom.
  • 10.
  • 11. When the window or containing element is resized, block elements expand or contract to the new width. block element block element block element block element block element block element
  • 12. When the window or containing element is resized, inline elements reflow to fit.  inline element inline inline element element inline element inline element inline element
  • 13. elements don’t overlap or bunch up, they make room for one another
  • 14. floated elements a.k.a ‘floats’
  • 15. floats can be used to create: multi-column layouts navigation toolbars table-like alignment (without tables) and much, much moreTM
  • 16. float: left; float: right; float: none;
  • 17. things you should know about floated elements
  • 18. a floated element is like an island in a stream I’m a block element that is beside an image that has been floated to the right. My contents will wrap around the image.
  • 19. floats stay in the content area of the containing element this isn’t possible
  • 20. margins are maintained img{ float: right; margin-left: 5px; margin-right: 5px; } I’m a block element that is beside an image that has been floated to the right. My contents will wrap around the image.
  • 21. always provide a width for floated elements p.floatRight{ float: right; margin: 5px; width: 120px; } I’m a block element that is beside an paragraph that has been floated to the right. My contents I’m a paragraph element, floated to the right, with a defined width will wrap around the paragraph.
  • 22. floated inline elements behave as block elements
  • 23. elements do not float higher than their reference in the source
  • 24. you can float multiple elements Because I am beside two floated elements (one left, one right), I wrap around both of them.
  • 25. there is one noticeable side effect of using floats...
  • 26.
  • 27. what we actually want to see is this...
  • 28.
  • 29. to achieve this effect, we need to make use of clearing
  • 31. clear: left; clear: right; clear: both;
  • 32. clear: left; The left value starts the element below any elements that have been floated to the left
  • 33. clear: right; Similarly, the right value makes the element clear all floats on the right edge of the containing block
  • 34. clear: both;  If there are multiple floated elements, and you want to be sure an element starts below all of them, use the both value to clear floats on both sides
  • 35. My position is governed by the floated elements to the left. I have not been cleared in any way. I have been cleared, so I start below the floated elements.
  • 37. CSS Positioning & CSS Grid Systems

Notas do Editor

  1. We&apos;ve shown you how boxes have layers that define how they are rendered and how they hold their contents.In there we also show how the properties of CSS that relate to the box model can define rules for how elements play together in the document.From there, we need to know how elements with those properties can use flow and positioning to work in page layouts and with mixed content.
  2. We&apos;ve covered it only lightly, but here we find out that elements are made up of two different kinds of box model sets. Block and Inline.
  3. Block elements will expand across the available width (unless constraints are placed on them) and clear any following content below them down the page. &lt;div&gt; and &lt;p&gt; elements are examples of these.
  4. Inline elements will sit within the flow of text or elements horisontally as well as vertically. They will by default, only take up width and height of their contents. &lt;span&gt; and &lt;a&gt; elements are examples of these.
  5. Since we introduced the box model last lesson it&apos;s important to know that our example was based around a block kind of element. Things change for inline elements, as they don&apos;t support the same kind of box model properties due to their nature:
  6. The Width property wont do anything on inlines since they are defined by their content and run inline with other content.Margins are only possible on the left and right, not top and bottom....and other things left to your experimentation :-)
  7. In the CSS layout model, text elements are laid out from top to bottom in the order in which they appear in the source, and from left to right (in left-to-right reading languages).Block elements stack up on top of one another and fill the available width of the browser window or other containing element.Inline elements and text characters line up next to one another to fill the block elements.
  8. When the window or containing element is resized, the block elements expand or contract to the new width.
  9. When the window or containing element is resized, the inline content reflows to fit.
  10. Objects in the normal flow affect the layout of the objects around them. This is what we&apos;ve been showing you with the box model examples and what you know from seeing websites in your own experience - elements don’t overlap or bunch up, they make room for one another.Now we start paying attention to whether elements are in the flow or removed from the flow. Floating and positioning changes the relationship of elements to the normal flow in different ways.
  11. The float property moves an element as far as possible to the left or right, allowing the following content to wrap around it. It&apos;s not a positioning scheme, but a unique feature built into CSS. 
  12. The float property moves an element as far as possible to the left or right, allowing the following content to wrap around it. It&apos;s not a positioning scheme, but a unique feature built into CSS.Floats are one of the primary tools of modern CSS-based web design, used to create multi-column layouts, navigation toolbars from list elements, and table-like alignment without tables.
  13. Floated elements continue to influence the surrounding content.Eg. If some paragraph text is near a floated element it reflows to make room for it.One popular analogy compares floats to islands in a stream - they are not in the flow, but the stream has to flow around them.
  14. It is also important to note that the floated element is placed within the content area (the inner edges) of the element that contains it.It does not extend into the padding area of the paragraph.
  15. The margin is held on all sides of the floated image. The entire element box, from outer edge to outer edge, is floated.
  16. It is necessary to specify a width for floated text elements because without one, the content area of the box expands to its widest possible width (or, on some browsers, it may collapse to its narrowest possible width).Images have an inherent width, so we don&apos;t need to specify a width (although we can).Basically, If you do not provide a width value, inside the browser the width of the floated block will be set to auto, which fills the available width of the browser window or other containing element.There’s not much sense in having a full-width floated box since the idea is to wrap text or elements next to the float, not start below it!
  17. The margin is held on all four sides of floated elements, even though top and bottom margins are usually not rendered on inline elements.This is because all floated elements behave like block elements.Once you float an inline element, it follows the display rules for block-level elements, and margins are rendered on all four sides.Margins on floated elements do not collapse (overlap) as normal though! So be aware!
  18. A floated block will float to the left or right relative to where it occurs in the XHTML source code allowing the following elements in the flow to wrap around it.It will stay below any block elements that come before it in the flow (in effect, it is “blocked” by them).That means you can’t float an element up to the top corner of a page, even if its nearest ancestor is the body element.If you want a floated element to start at the top of the page, it must appear first in the document&apos;s source code.
  19. It’s perfectly fine to float multiple elements on a page or even within a single element.When you float multiple elements, there is a complex system of behind-the-scenes rendering rules that ensure floated elements do not overlap.Floated elements will be placed as far left or right (as specified) and as high up as space allows.When a series of sequential paragraphs are floated to the same side (left), the first floats start stacking up from the left edge, but when there isn&apos;t enough room for the last one, it moves down and to the left when it bumps into something; e.g. the edge of the browser window.
  20. A floating image obscures borders of block boxes it overlaps.
  21. Both paragraphs have set &apos;clear: left&apos;, which causes the second paragraph to be &quot;pushed down&quot; to a position below the float — &quot;clearance&quot; is added above its top margin to accomplish this (see the &apos;clear&apos; property).
  22. The last thing you need to know about floated elements is how to turn the text wrapping off and get back to layout as usual.This is done by clearing the element that you want to start below the float.
  23. Applying the clear property to an element prevents it from appearing next to a floated element, and forces it to start against the next available “clear” space below the float.Keep in mind that you apply the clear property to the element you want to start below the floated element, not the floated element itself.
  24. The left value starts the element below any elements that have been floated to the left
  25. Similarly, the right value makes the element clear all floats on the right edge of the containing block.
  26. Similarly, the right value makes the element clear all floats on the right edge of the containing block.