How can I create a CSS value that is dependent on other values?
Dec.06, 2006 in
CSS
Multimediocrity asked:
I have box 1 and box 2. I want the height of box 3 to be the sum of the heights of box 1 and 2. How could I go about doing this? Thanks!
I will very much appreciate a good answer to this question, as this piece of information is very important to several projects I am and will be working on. Thanks!
Tags: CSS, Good Answer
Custom Search
December 7th, 2006 at 5:50 pm
Use JavaScript to do it for you.
var oBox1 = document.getElementByID(“Box1”)
var oBox2 = document.getElementByID(“Box2”)
var oBox3 = document.getElementByID(“Box3”)
var ht = oBox1.style.height + oBox2.style.height
oBox3.style.height = ht