2011-12-27 99 views
2

我想旋转一个简单的GWT标签。有什么选择吗?在GWT中旋转标签

我已经建立了一个简单的CSS样式:

.rotate{ 

/* Abs positioning makes it not take up vert space */ 
position: relative; 
top: 330; 
left: 330; 

/* Border is the new background */ 
background: none; 



-webkit-transform: rotate(90deg); 
-moz-transform: rotate(90deg); 
-ms-transform:  rotate(90deg); 
-o-transform:  rotate(90deg); 
} 

但是,当我的风格添加到标签没有奏效。

+0

请张贴你如何应用这种风格的例子,因为它绝对适合我。 –

+0

我将标签添加到absolutePanel: 'Label rotated = new Label(“this must be rotated”); \t \t \t rotated.addStyleName(“rotate”); \t \t \t add(rotated);' – destiny

+0

使用您的浏览器检查元素并确保它实际上应用了该样式。 CSS文件是否明确包含在模块的HTML文件中? –

回答

2

CSS仅在Chrome,Opera,Firefox,Safari和IE9 +中转换工作(使用浏览器特定的CSS属性)。您对所有这些使用正确的转换语法。对于旧版本的IE,你可以改变这样的:

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); 
+0

谢谢:)它工作fpr我在IE浏览器:) – destiny

0

如果你想使一个垂直文本,或者我建议考虑使用SVG图形任何其他文本转换。