473,382 Members | 1,387 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,382 software developers and data experts.

Automatic Sizing of DIVs

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 div depending on what tab
it was. Data for some tabs has more height than others... is there a
way to make the div's height auto adjust to the html?

As a side note, I noticed that in one of my tabs I used a table in the
html and the div resized to the table height. Are there any other
containers (such as a span maybe) that DIVs will auto-resize for?

Thanks!

Nov 20 '06 #1
2 4033
On 2006-11-20, Bryan <BT**********@gmail.comwrote:
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 div depending on what tab
it was. Data for some tabs has more height than others... is there a
way to make the div's height auto adjust to the html?
Yes, set height: auto on the div, which is the default anyway.

It's not clear why you're getting the reported problem, unless you're
inadvertently setting the height on the div somewhere.
Nov 20 '06 #2
Ben C wrote:
On 2006-11-20, Bryan <BT**********@gmail.comwrote:
>>
Data for some tabs has more height than others... is there a
way to make the div's height auto adjust to the html?

It's not clear why you're getting the reported problem, unless you're
inadvertently setting the height on the div somewhere.
I'd suspect absolute positioning of the div content, but that's just a
guess. Hard to say without a URL.

--
Berg
Nov 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sujith | last post by:
It will be great if any one helps me in sizing fonts in browser!!! I tried this code it worked in Konqueror but not in Mozilla I need a solution that will work in IE,Netscape,Mozilla etc.... ...
15
by: red | last post by:
How do I center two side by side divs ? I've been writing css pages for a while but there's one thing tha still eludes me. I can center a div with margin auto. I can place two divs side by side...
39
by: WindAndWaves | last post by:
Hi Gurus I have a page, which looks a bit like this: .... <body> <div ID=id1>................</DIV> <div ID=gsd>................</DIV> <div ID=ewd>................</DIV> <div...
12
by: meltedown | last post by:
I would like the floating divs to float and then the header to come after them , on the left. That's what I thought clearing the floats was for, but in this example, the header is to the right of...
2
by: tasman.hayes | last post by:
I'm experimenting with converting a site from a table layout to CSS. I'm floating three DIVs in a row for the top of a website (a logo, navigation buttons and a email list signup box). The DIVs...
1
by: rsteph | last post by:
I've got a page with a menu div that is 1066px wide by 150px high. And then I have some images that are 150px by 150px for the menu items. I put the images in a table that is set to 150x150px with a...
11
by: Christoph | last post by:
This CSS declaration doesn't do anything on my page, for some reason. I've made heavy use of this technique in other places, and it works. It's not a problem with the alt value, either. This shows...
1
by: Ben C | last post by:
On 2008-11-16, Hannah <hu47121+nospam@usenet.kitty.sub.orgwrote: I think Konqueror is wrong. You've asked for the images to be 100% of their containers, which should work even though the...
0
by: dorayme | last post by:
In article <gfvfdd$7vj$1@oxygen.pond.sub.org>, hu47121+nospam@usenet.kitty.sub.org (Hannah) wrote: Just to tell you that this latest one loads very fast on my machine now and much easier to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.