Witam,
Mam główny div w którym jest kolejny div. I teraz chccę żeby wysokośc głównego diva wzrastała wraz z wysokością diva który jest w nim, jak to zrobić? Jak usune z niego height to robi się bardzo krótki i div w nim wystaje za niego.
div#glowny { height: auto !important; height: 20px; min-height: 20px; }
function allocateSidebarHeight() { var contentDom = document.getElementById("rightcolumn"); var sidebarDom = document.getElementById("leftcolumn"); if(contentDom.offsetHeight > sidebarDom.offsetHeight) { sidebarDom.style.height = (contentDom.offsetHeight)+"px"; } else if(sidebarDom.offsetHeight > contentDom.offsetHeight) { contentDom.style.height = (sidebarDom.offsetHeight)+"px"; } } window.onload=allocateSidebarHeight;