سؤال

I programming very simple layout. It consist 5 div -> http://jsfiddle.net/8tSk6/ . I want that div with ID "kubka" equal 100% - 100px (height: calc(100% - 100px);). Unfortunately, it doesn't work. I try apply tips with CSS3 height: calc(100%) not working (add height = 100%,margin & padding = 0), but script still doesn't work.

هل كانت مفيدة؟

المحلول

1) you need to add html {height:100%;}

2) remove the spaces between your div and # - what your styles mean is an id of whatever found inside a div and if you look at your www div it is not inside any other div

If you sort these out i think it will work: fiddle

نصائح أخرى

You could use javascript to get the height of the element and then change it :

function updateHeight(divId){
    var urDiv = document.getElementById(divId);
    urDiv.height = window.innerHeight - 100;
    urDiv.style.height = urDiv.height + "px";
}

Hope it solves your problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top