Hi,
I'm trying to use CSS styling to rotate text in a label. It generally works, i.e. the text gets rotated, but the label becomes much larger at the same time, making it very difficult to use this in layouts.
I'm testing it in Chrome.
Here's my CSS:
And my Java:
The generated HTML looks like this when THERE IS NO ROTATION:
After applying the "rotate" style, the code remains almost the same - with the following difference: the width and height of the outermost div become 54 and 138, respectively.
Any idea why this happens and how to possibly fix it?
Best,
Michał
I'm trying to use CSS styling to rotate text in a label. It generally works, i.e. the text gets rotated, but the label becomes much larger at the same time, making it very difficult to use this in layouts.
I'm testing it in Chrome.
Here's my CSS:
Code:
.rotateFull { /* Firefox */ -moz-transform: rotate(-90deg) translate(0, 100%); -moz-transform-origin: 0% 100%; /* Opera */ -o-transform: rotate(-90deg) translate(0, 100%); -o-transform-origin: 0% 100%; /* Safari + Chrome */ -webkit-transform: rotate(-90deg) translate(0, 100%); -webkit-transform-origin: 0% 100%; /* IE */ -ms-transform: rotate(-90deg) translate(0, 100%); -ms-transform-origin: 0% 100%; /* Internet Explorer */ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); }
Code:
final Label sampleNameLabel = new Label( "....." ); sampleNameLabel.setWidth( 19 ); sampleNameLabel.setHeight( 70 ); sampleNameLabel.setStyleName( "rotate" ); sampleNameLabel.setShowEdges( true ); sampleNameLabel.setEdgeSize( 1 );
Code:
<div id="isc_5Q" eventproxy="isc_Label_8" style="position: absolute; z-index: 200702; margin-left: 1px; margin-right: 1px; margin-top: 1px; margin-bottom: 1px; overflow-x: visible; overflow-y: visible; width: 36px; height: 68px; left: 0px; top: 0px; cursor: default; " onscroll="return isc_Label_8.$lh()"> <div id="isc_5R" eventproxy="isc_Label_8" style="position: relative; visibility: inherit; z-index: 200702; cursor: default; "> <table cellspacing="0" cellpadding="0" width="17" height="68"> <tbody> <tr>he rotation, <td class="normal" align="left" valign="center">662715</td> </tr> </tbody> </table> </div> </div>
Any idea why this happens and how to possibly fix it?
Best,
Michał
Comment