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 6: Adding Images > Add Space Around an Image

Add Space Around an Image

Most web browsers display only a small amount of space between images and text. You can increase the amount of space, also called padding, to make the page more visually appealing and easier to read. You can control padding on all sides of an image at once with the padding property. You can also apply padding on just one side with the padding-top, padding-bottom, padding-left, and padding-right properties. Padding can add whitespace between the image and its caption.

Add Space Around an Image

9781118063514-fg0627.eps

001 Create a CSS class for the <img> tag.

Note: See Chapter 4 for more about CSS classes.

9781118063514-fg0628.eps

002 For the class declaration, type padding: ?, replacing ? with the amount of padding.


  

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