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

Chapter 10. Aligning, Floating, and Posi... > Horizontally Aligning Block Elements

Horizontally Aligning Block Elements

You also learned to create a centered box in the previous chapter by setting equal left and right margins outside of the box; you can also right-align the box by setting the right margin to zero. There are some limitations, however, in these two approaches:

  • The text-align property doesn't actually horizontally align an element relative to the page, but only horizontally aligns text or other objects nested within an element relative to an element's content area.

  • Setting equal left and right margins to center a boxed element only works if the width of the element's content area is unspecified or set to auto (the default).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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