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

Night Drive > Absolute-Positioning Trickery

Absolute-Positioning Trickery

This set the stage for the photographs, but pulling them into the header posed an additional challenge within the layout: Absolute positioning doesn’t work well with centering. Shea employed a useful trick to work around the problem: He absolutely positioned the parent elements along the left edge of the screen, set their width to 100% to have them span the entire browser window horizontally, and centered the child elements—in this case the spans—within the parent.

Accounting for various browser bugs, this is the code required:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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