2 Replies - 942 Views - Last Post: 21 April 2011 - 01:34 AM

#1 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

AUTO keyword in CSS

Posted 20 April 2011 - 11:51 PM

Can somebody tell me what does the offset keyword AUTO do in CSS? For example if we consider the offset property top of a div 1 inside another div 2, then positioning the div 1 absolutely, and setting the top offset property to 50% means the gap between the top of the div 1 and that of div 2 will be 50% of the height of div 2, right? Likewise if we set top to 30px, it means there will be a gap of 30px between the tops. What, then, will happen if we use AUTO for top? If this example cannot make it clear, please provide another one! Thanks.

This post has been edited by cupidvogel: 20 April 2011 - 11:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: AUTO keyword in CSS

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: AUTO keyword in CSS

Posted 21 April 2011 - 01:29 AM

Hey.

From W3C's CSS 2.1 Specification:

Quote

For non-replaced elements, the effect of this value depends on which of related properties have the value 'auto' as well. See the sections on the width and height of absolutely positioned, non-replaced elements for details. For replaced elements, the effect of this value depends only on the intrinsic dimensions of the replaced content. See the sections on the width and height of absolutely positioned, replaced elements for details.

I'm way to tired to decipher that at the moment though xD

The way I've always looked at it, the AUTO value is just "normal" or "non-specific". A way to make the browser deal with positioning it according to the flow of the other elements. - Only time I ever specifically set a style to AUTO is to override a specific value from a previous, overlapping style.
Was This Post Helpful? 1
  • +
  • -

#3 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Re: AUTO keyword in CSS

Posted 21 April 2011 - 01:34 AM

Thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1