This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


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: 61306
    
  66

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: 61306
    
  66

Sometimes the act of posting scares bugs into fleeing into oblivion!
 
GeeCON Prague 2014
 
subject: DIV height and appendChild