Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. How Can I Flow Text Around Images?

Chapter 4. How Can I Flow Text Around Images?

It's time to bring the sample page alive with some images. The reason I have not used images so far is because HTML treats images as inline elements. As you saw in the previous chapter, inserting an image in a block of text forces the text to align with the bottom of the image. In order to get the text to flow around the image, you need to use the CSS property called float. In principle, using float is very simple, and it can be used on any HTML element, not just images. You float the element to the left or right, and everything moves up to fill the vacated space alongside, as illustrated in Figure 4-1.

Figure 4.1. The CSS float property is used, among other things, to wrap text around images.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint