我正在尝试使用屏幕顶部选项卡的 css值将双尖括号设置为:after
伪元素中的内容。以下是相关代码:transform
rotate(90deg)
.header {
-moz-transition: top .5s ease;
-webkit-transition: top .5s ease;
-o-transition: top .5s ease;
transition: top .5s ease;
position: absolute;
left: 0;
right: 0;
top: -60px;
height: 80px;
background-color: #2d2;
}
.header.in-top {
top: 0;
}
.header-tab {
position: absolute;
bottom: 0;
width: 100%;
height: 20px;
text-align: center;
color: #000;
-moz-transition: color .5s ease;
-webkit-transition: color .5s ease;
-o-transition: color .5s ease;
transition: color .5s ease;
}
.header-tab:hover {
color: #e22;
}
.header-arrow:after {
font-size: 20px;
line-height: 1;
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.header .header-arrow:after {
content: "\00bb";
}
.header.in-top .header-arrow:after {
content: "\00ab";
}
<div class="header">
<div class="header-tab" data-toggle="in-top">
<span class="header-arrow"></span>
</div>
</div>
该data-toggle
属性在 JavaScript 中用于切换in-top
类,以切换双尖括号的方向,以及通过将标题下拉来显示标题的内容。我指定的transform
属性似乎什么也没做。有什么解决办法吗?