7 Harnessing the full power of float

 

This chapter covers

  • Creating a drop cap using float
  • Using float to wrap text around the image
  • Using CSS shapes to make the text follow the floated image’s shape

Grid and flexbox have given us the ability to create layouts that were previously incredibly difficult if not impossible to realize, one of the most common examples would be a three column layout with all three columns the same height regardless of the contents within. Another layout technique, which unlike its grid and flexbox counterparts has been around for quite some time, is float. Part of the CSS Logical Properties and Values Level 1 Module, float is purpose built to allow other content to wrap around the element being floated and as result really shines at manipulating images inside of text and at creating drop caps.

7.1 Adding a drop cap

7.1.1 Leading

7.1.2 Justification

7.1.3 First Letter

7.2 Styling the quote

7.3 Curving text around the compass

7.3.1 Shape-Outside: Circle

7.3.2 Clip-Path

7.3.3 Shape-box

7.4 Wrapping text around the dog

7.4.1 Using path()... or not yet

7.4.2 Using the image

7.4.3 Shape Margin

7.5 Summary