I'm stumbling around in javascript because i couldn't seem to get where I wanted to go in CSS.
I want to size a division tag so that the height of the element varies depending on the size of the browser. I'm not concerned about the size of the view (the user may have the window partially minimized, but I don't care). I want to make the main box bigger if the screen is bigger.
It doesn't work. I have been tinkering with a variable (thisHeight). Let's say that other elements on the page will take up at least 400 px. I want the division tag to be sized based on the height of the screen - 400 px. It doesn't work yet.
All help is appreciated,
MrsBean
I want to size a division tag so that the height of the element varies depending on the size of the browser. I'm not concerned about the size of the view (the user may have the window partially minimized, but I don't care). I want to make the main box bigger if the screen is bigger.
It doesn't work. I have been tinkering with a variable (thisHeight). Let's say that other elements on the page will take up at least 400 px. I want the division tag to be sized based on the height of the screen - 400 px. It doesn't work yet.
Code:
<script>
var thisHeight
thisHeight = screen.height
thisHeight = screen.height-400
document.getElementById('mainbody').style.height=thisHeight+'1px'
</script>
<div id="mainbody">
</div>
All help is appreciated,
MrsBean