473,326 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Automatic DIV Height

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
3 1764
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MB | last post by:
Hi! I am trying to make a dynamic GroupBox that will contain a variable number of child controls of a single type, e.g. RadioButtons or CheckBoxes. I want to read the neccesarry information...
5
by: Abhishek Srivastava | last post by:
Hello All, There is a particular feature which I want to have in visual studio .net suppose I create a class ClassA { private string name; private int age;
2
by: Carlo Marchesoni | last post by:
I have a very basic question using the DataGrid. What I want to achieve is controlling the size of it (specially the height of the rows). The DataGrid adjusts the row size according to the amount...
1
by: Raed Sawalha | last post by:
Is it possible to make the following div to generate automatic line feed when user start writing and reaches the DIV bounderies like in textarea, the case I have when type a continous chars without...
1
by: peconi | last post by:
Hi, The script I use to automatically resize a table works great in Internet Explorer, but in any other standards compliant browser it does not. Can anyone help me make it work in Firefox? ...
7
by: T J Rogers | last post by:
Hi folks, Below is a script that I use on a site to detect the size of the browser window then automatically load an alternative stile sheet when appropriate. Its a bit clumsy, and I don't...
2
by: Bryan | last post by:
Hello all, I'm using innerHTML to add html content to a div on my site. I have tabs along the top of a div that is outlined with a line. When a tab is selected, html data is inserted into the...
13
underscore
by: underscore | last post by:
gud day to all TSD. if i run the code below which is HTML combine with php. my problem encoutered in php code. it will automatically save all blank textbox i declare in php to my database using...
4
by: Slickuser | last post by:
How do I automatic move the X & Y to create a ellipse function as below, DrawCircle? Or there any sample source code out there? I want it move down by user input. How can I achieve this?...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.