Adjusting everything

liunx

Guest
I have several divs, nested in a container, arranged in such a way that changing the size of one, usually means adjusting the sizes of the others. It's time consuming.

Will it ever be possible to do this (or something similar), basically replacing attribute values with variable names.

<style type="text/css">

/*My_CSS_Variables*/
var divOneWidth = 50;
var divTwoWidth = 50;
var containerWidth = divOneWidth + divTwoWidth;

div#divOne {width:divOneWidth + 'px'; }

et cetera ad nauseam...

</style>

It's a horrible idea I know, but it would save me some time and brain power trying to work out why some menu has popped over to one side in IEIn IE you can use expression (<!-- m --><a class="postlink" href="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp">http://msdn.microsoft.com/workshop/auth ... recalc.asp</a><!-- m -->) and it will be possible when css3 is implemented.

The chances are that what you want to do can be done using css, but we need to see the document and a fuller explanation.Thanks for that article.

I just want to use a variable or expression to ensure that when I am nesting div tags with set widths and heights, they maintain a fixed spatial relationship for example.

style
div#container {
width:(a variable expressing the value of the
combined widths of left and right including padding, borders etc);
}
div#leftDiv {
width:50px;
height:50px;
float:left;
}
div#rightDiv {
width:50px;
height:50px;
float:left;
}


html
<div id=container>
<div id=leftDiv>left</div>
<div id=rightDiv>right</div>
</div>

If I could set up this kind of relationship it would create a few interesting possibilities for page layout and dhtml. The article you provided explains a fair bit, but is there anyway to get the above working in a barebones fashion?If the inner divs are of fixed width then you always know the total width. So what's the problem?There's no problem at all, I just want to know if things can be done like that and if it's possible to put anthing other than a specific value after a colon in css code.

---
Sorry if my terminology/ideas are all wrong, I'm a sickening dilletant when it comes to web pages. The only reason I ever became curious is because I showed my boss my home made portfolio web page and now the tight arsed b*****d makes me do all the company web pages, which are admittedly now, better than they were - mostly thanks to web developer dot com
 
Back
Top