Electric Type

Multimedia

About Us

News

Help

Introduction to CSS Positioning

Page 3 — From the Top

The left and top properties refer to the amount of space from the starting position of the element. A relatively positioned element will fall wherever it would have ended up anyway, but it will also be knocked to the left and toward the top (and yes, negative values are allowed).

Absolutely positioned elements show up the number of units you specify from the left and top of their parent element. Units are in the standard CSS units: pixels - px, points - pt, inches - in (get with this century!), and percentage - %. I like using percentage, it's my friend.

So a <div> that's at the top level of the HTML hierarchy with an absolute positioning of left: 50px, top: 50px, would appear 50 pixels from the left, and 50 pixels from the top of the page.

If it was nested inside a paragraph at left: 100, top: 100, then the <div> would be 150 from the left and top of the document.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.