[SOLVED - solution described way below]
#mycontainer {
margin: 0 auto;
width: 30em;
}
This mark-up centers.
So, later,
$('#mycontainer').css("-webkit-transform", "scale(0.8)");
$('#mycontainer').css("-moz-transform", "scale(0.8)");
$('#mycontainer').css("-ms-transform", "scale(0.8)");
$('#mycontainer').css("-o-transform", "scale(0.8)");
$('#mycontainer').css("transform", "scale(0.8)");
The markup does not change, just the "appearance", i.e., it "appears" scaled down.
Is all the above accurate?
And, if so, how do I portably center the object and stop there?
From my testing, Safari does what I want with the code above, whereas the other Browsers also shift the scaled-down object to the right, which is not what I want.
In direct response to your valid comments, here is a jsFiddle to more completely illustrate my point: http://jsfiddle.net/johnlove/yL2td3r2/
But, before you peek at this jsFiddle, let me verbally try to explain what I'm trying to do.
I start out with the standard css for centering a division. Then, I hook a resize method into the window's onresize Event. And in that Event, I want to keep the division centered and scale down with the transform center at its default center (50,50); e.g., for scaling to 0.8, that means bringing in the left edge 10% and the right edge 10% keeping the center the same (50,50).
Sounds simple enough ... BUT, the whole division is shifted ... and shifted ONLY when the enclosing window gets super thin ... the division gets scaled down and remains centered UNTIL the window gets really, really thin.
I remember a line in a very, very, very old movie in which the actor blurts out "I'm fading, I'm fading". Field of Dreams. At this juncture, this sounds like a very appropriate line for me.