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

Chapter 8. Space Around Boxes > Using the Border Property

Using the Border Property

Unlike the margin and padding properties, the border property cannot set different values on the four sides. With border, you can only set all four sides to the same style, color, and width. To set different values on the four sides, you must use one or more of the other border properties.

The following style sheet puts a thick red border around elements of type DIV with CLASS “warning.” Between the text and the border is half an em vertically and one em horizontally:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint