By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,339 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,339 IT Pros & Developers. It's quick & easy.

Automatic DIV Height

P: n/a
Hello all,

I'm filling an empty div with html code using innerHTML. Right now I'm
bordering the div using the CSS border property and I'm setting the div
with a hard coded height using the CSS height property. However, I
would like to have the height of the div be automatically fit to the
data displayed inside of it. If I leave the height property out of the
CSS declaration for the div, then the bottom of the div border is right
below the top of the div border and all of the data set using innerHTML
ends up below the border.

How can I make it so that the div height automatically fits the data
inside of it set by innerHTML?

Thanks in advance!

Nov 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Just wanted to bump this back up... does anyone know how to do this?!

On Nov 13, 7:30 pm, "Bryan" <BTRichard...@gmail.comwrote:
Hello all,

I'm filling an empty div with html code using innerHTML. Right now I'm
bordering the div using the CSS border property and I'm setting the div
with a hard coded height using the CSS height property. However, I
would like to have the height of the div be automatically fit to the
data displayed inside of it. If I leave the height property out of the
CSS declaration for the div, then the bottom of the div border is right
below the top of the div border and all of the data set using innerHTML
ends up below the border.

How can I make it so that the div height automatically fits the data
inside of it set by innerHTML?

Thanks in advance!
Nov 20 '06 #2

P: n/a
Bryan said the following on 11/19/2006 7:36 PM:

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Just wanted to bump this back up...
"bump this back up" to where?
does anyone know how to do this?!
What does a CSS question have to do with JS?

But, just for giggles, what happens when you hard code the HTML in the
page and view it? Make it work that way and then script it to your delights.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 20 '06 #3

P: n/a
Sorry, just now realized this is the wrong area to ask the question.

Thanks for the advise anyway!

Randy Webb wrote:
Bryan said the following on 11/19/2006 7:36 PM:

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Just wanted to bump this back up...

"bump this back up" to where?
does anyone know how to do this?!

What does a CSS question have to do with JS?

But, just for giggles, what happens when you hard code the HTML in the
page and view it? Make it work that way and then script it to your delights.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.