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

Chapter 21. Cascading Style Sheets and C... > Using Relative Positioning

Using Relative Positioning

You also can position elements in a relative way, where they’re positioned relative to the location they would have had in the normal flow of elements in the web browser. To position items in a relative way, you set the position style attribute to relative, and then you set properties such as left and top to specify the new relative position. What is the element being positioned relative to? It’s positioned with respect to the place the browser would normally display the element if you didn’t move it yourself.

Here’s an example. In this case, I’m moving some text up six pixels and other text down six pixels from the normal position at which the browser would place that text:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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