cbresources — 2011-09-04T21:16:33-04:00 — #1
I am attempting to place an HTML object on a page but I'm having issues with the height.
The object varies in height depending on the content, which updates constantly as it is a list of the latest posts on our forum.
I have set the height as 100% like so:
<object scroll="no" style="width: 200px; height: 100%;" data="http://ivegotkids.com/community/user/index.php/latest-discussions"> </object>
But this is giving me a huge gap at the bottom of the object because it's giving me 100% of the screen size, not the actual content.
How do I set the height to stop at the bottom of the content and not at the bottom of the screen.
felgall — 2011-09-04T22:43:32-04:00 — #2
Have you tried leaving out the height completely?
cbresources — 2011-09-04T23:03:51-04:00 — #3
Yes, when I do that the frame sets itself a default size which is only a fraction of the size that's needed and I end up with a scroll bar to see the rest of it... I need it to be 100% but it should be 100% of the page size not 100% of the screen size.
antuntun — 2011-09-05T11:14:55-04:00 — #4
On which browser you saw this?
cbresources — 2011-09-05T17:25:37-04:00 — #5
antuntun — 2011-09-06T08:55:06-04:00 — #6
This is really confusing, height: 100% should stretch it according to content. Can you provide some link so that we can see it live?
ralphm — 2011-09-06T10:23:37-04:00 — #7
No, it's based on the element's container, not its content.
Perhaps JS is needed for this. It would detect the content height and set the height on the object accordingly.
gary_turner — 2011-09-06T11:44:11-04:00 — #8
It is my experience that object will size itself to its content if possible. Be sure to use the "type" attribute, e.g. type="text/html".