centering div vertically in dynamic sized page (using percent)

43 views Asked by At

Is there any way to achieve this here html css example

without using the translate transform.

Its about the div with id clockstring.

edit: I want to center the clockstring in each panel. I use top50% and transform y -50% for that. I wanna know if thers better solutions. And ya the upper string should be rotated too. It should look like in example wthout using transform translate.

best regards

1

There are 1 answers

0
Dalton Russell On

Point of clarification: Are you attempting to center the element, or are you trying to rotate and flip it? The title asks about centering, but you go on to ask about translate and transform.

Another method would be to use a script. Maybe something along the lines of this.

<SCRIPT LANGUAGE="JavaScript"> <!-- hide from none JavaScript Browsers Image1= new Image(75,50) Image1.src = "goof3.gif" Image2 = new Image(75,50) Image2.src = "goof4.gif" function SwapOut() { document.imageflip.src = Image2.src; return true; } function SwapBack() { document.imageflip.src = Image1.src; return true; } // - stop hiding -->