变换rotate()无法正常工作

时间:2012-12-01 11:32:18

标签: css css-transforms

我无法弄明白为什么css转换:rotate()不起作用。 这是代码:http://jsbin.com/afayan/1/edit 当我将背景颜色添加到“内容”类时,转换不起作用...

2 个答案:

答案 0 :(得分:0)

您必须为两个内容添加正确的z-index。或者删除z-index。

更新:

Code

答案 1 :(得分:0)

这是关于z索引的。试试这个:

.content { padding:50px; background: green; z-index: 5; }
.box { background:#ccc; padding:50px; position:relative;}
.box:after { content:''; width:100%; height:100%; left:0; top:0; 
             background:red; position:absolute; z-index:4; 
             -moz-transform: rotate(2deg); transform: rotate(2deg); 
             -webkit-transform: rotate(2deg); }
相关问题