offsetHeight and position/float

Discussion in 'CSS' started by alfgeorg, Apr 23, 2008.

  1. #1
    What are the rules for getting the correct offsetHeight of a div? This gives the correct offsetHeight of the contens: <div id="container" style="position:relative;float:left><div id="contens" style="position:relative;float:left;">Some text</div></div> But this will not: <div id="container" style="position:relative;float:left><div id="contens">Some text</div></div>.
     
    alfgeorg, Apr 23, 2008 IP
  2. gopalkr

    gopalkr Member

    Messages:
    91
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Both the codes seem to give the same result. In which context do you expect to see a difference? Is it for a middle paragraph?
     
    gopalkr, Aug 31, 2009 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Dunno if this is in your real code but there's no closing " after the float: left.
     
    Stomme poes, Sep 1, 2009 IP