SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I find the height of a <div>?

    I have some <div>s, which all have style.height = auto, or don't have a style.height, so they default to auto.

    How can I find out the absolute height of the <div>?

    Thanks,
    Shai

  2. #2
    d^_^b Iain G's Avatar
    Join Date
    Nov 2005
    Location
    Gloucester, UK
    Posts
    262
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not quite sure what you're after, but if it's the size of the div when the page is rendered you can get this with the offsetHeight property. Unfortunately this is an IE proprietary property (try saying that when you're half-cut) but has pretty good support.

    Off the top of my head, not sure if there's a W3C DOM equivalent.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •