• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

div 'overflow:auto;' css question...

 
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok I have a 'Content' div inside a td of a table. That content div's width and height are set to 100% of that td's width and height.
Inside the 'Content' div I have two additional div's; 'GuildInfo' and 'Comments'. 'GuildInfo' has static text that will be the same wrote
directly in the html. 'Comments' however is fed it's contents via php from different comment files from different users.

'Comments' overflow is set to 'auto', but when the text inside the 'Comments' div (even though it's set to auto) gets longer than the 'Content' div, it makes
it expand in both IE and FF.

How can I resolve this? instead of using %'s should I use absolute 'px' width and height for the two div's 'Comments' and 'GuildInfo'?

Oh yea, 'Comments' and 'GuildInfo' both have a width of 100% of the 'Content' div and a height of 47% of the 'Content' div.

Thanks,

Justin
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Width and height must be fixed for overflow to work as you expect.
 
Justin Fox
Ranch Hand
Posts: 802
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool, I guess I just thought it was working correctly because I didnt have enough text in the div yet.

Thanks again!

Justin
 
machines help you to do more, but experience less. Experience this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic