This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes DIV height and appendChild Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DIV height and appendChild" Watch "DIV height and appendChild" New topic
Author

DIV height and appendChild

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

When you add an element to a DIV using appendChild, the parent DIV's height does not adjust to fit the child element(s). Anyway I can do this somewhat dynamically since I won't ever be sure how many children I am adding to the parent?

Thanks.


GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60773
    
  65

Originally posted by Gregg Bolinger:
When you add an element to a DIV using appendChild, the parent DIV's height does not adjust to fit the child element(s).


Sure it does, unless of course, you have over-ridden the height with a fixed size using CSS. Is that the case?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Bear Bibeault:


Sure it does, unless of course, you have over-ridden the height with a fixed size using CSS. Is that the case?


Yea, I knew that. And I don't know what happened between then and now, but it's working. Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60773
    
  65

Sometimes the act of posting scares bugs into fleeing into oblivion!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DIV height and appendChild
 
Similar Threads
Absolute div dynamically appended to body element
jQuery getting parent().parent()
Changing the text inside the first TextBox , the last div gets updated
Dynamically add inputs to a form
dynamically adding textboxes