Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto expandable and scrollable div 2

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hi guys ;)

How can I make a div vertically and horizontally expand to the maximum size of its container and also have scrollbars displayed when the container is scaled down?

The following works perfectly on IE but ...

On FF : the scoll bars aren't displayed at all.
On Opera : the scroll bars are displayed but the div expands outside its container (weird!).

Code:
#cust-bloc-main {

width: 100%;
height: 100%;
overflow: auto;

}

Thanks !
 
Again, I never use doctype.
So, for me, the 96% height works great on XP with FF, IE and Opera.

Maybe, if you try to remove the doctype, it will work on Mac too.
 
You should use a DocType.
By doing so and getting the page to work you can be sure that it will work correctly in any compliant browser (any current browser and those in the future).
That is the point. By leaving it out as you insist on doing you are relying on the browser's 'best guess' as to what to do. This may be 'right' but it's the Doctype that determines what is right and what is not right.
Take control of your work and use a Doctype. Removing it so your page looks right is so backwards.

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
That said, I don't think I've ever seen a fluid layout with a footer that stays at the bottom of the screen when using a proper doctype (none quirks), I've seen it done with javascript and position absolute though.
 
There's lots of examples of the footer staying at the bottom of the screen. Most of them use negative margins or absolute positioning but they will still be valid to their appropiate doctype.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top