【发布时间】:2018-04-20 11:48:20
【问题描述】:
Class Event 1 是我试图通过直接放置类而不添加悬停属性来实现的,尽管它适用于Hover Elements。
请检查this笔,您可以按照以下说明找到问题:
- 在“名称”中输入任何内容
- 点击
Tab
您应该到达第一个状态(左侧和底部的橙色边框和一些过渡效果),它从右上角拉自己,我不明白它为什么这样做。它在上面引用的Hover Example 中完全完美。
理解我的 CSS
.draw {
transition: color 0.25s;
它给出了一个 2px 透明的假想边框,我们稍后会突出显示
&::before,
&::after {
border: 2px solid transparent;
width: 0;
height: 0;
}
这是您从左上角开始转换 ::before 的地方
/* This covers the top & right borders (expands right, then down) */
&::before {
top: 0;
left:0;
}
这将改变文本的颜色。
&.dj {
color: rgb(255,123,0);
}
这里我想把它扩大到 66% 的宽度。
/* Class styles */
&.dj::before,
&.dj::after {
width: 66%;
height: 100%;
}
是否必须添加/推荐::after?
&.dj::before {
border-bottom-color: rgb(255,123,0);
border-left-color: rgb(255,123,0); // Make borders visible
transition:
height 0s ease-out, // Width expands first
width 0.25s ease-out; // And then height
}
}
【问题讨论】:
标签: javascript css css-transitions transition