作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 css bounce-effect 结合了一个标签(该代码用于不太严肃的聊天),它使文本在弹跳时不完全可见。
这是问题的一个例子: https://jsfiddle.net/ohkgqy13/1/
这是 CSS:
bounce {
display: inline-block;
animation: bounce 1s infinite alternate;
-webkit-animation: bounce 1s infinite alternate;
}
@keyframes bounce {
from {
transform: translateY(0px);
}
to {
transform: translateY(-15px);
}
}
@-webkit-keyframes bounce {
from {
transform: translateY(0px);
}
to {
transform: translateY(-15px);
}
}
.container {
background-color: #eee;
}
和 HTML:
<div class="container">
<marquee><bounce>ASDF</bounce></marquee>
</div>
我不知道如何解决这个问题。感谢您的帮助。
最佳答案
文本溢出其容器。增加行高,以便在溢出之前有更多空间。如果您需要更高的边距,您可以随时更改上边距以抵消它。
<div class="container" style="line-height: 60px; margin-top: -5px;">
<marquee><bounce>ASDF</bounce></marquee>
</div>
bounce {
display: inline-block;
animation: bounce 1s infinite alternate;
-webkit-animation: bounce 1s infinite alternate;
}
@keyframes bounce {
from {
transform: translateY(20px);
}
to {
transform: translateY(-20px);
}
}
@-webkit-keyframes bounce {
from {
transform: translateY(20px);
}
to {
transform: translateY(-20px);
}
}
.container {
background-color: #eee;
}
关于html - 用选取框弹跳使文本不完全可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52240133/
在下面的代码中,我想不必添加undefined作为filteredDevice的类型注解。我认为一个被过滤的设备不应该是未定义的,因为我过滤掉了未定义的设备。 但是如果我删除 undefined类型注
我有一个 UIButton,其文本来自服务器。按钮的宽度是固定的。我想要的是,如果按钮的文本超过按钮的宽度,文本应该在按钮内选取框。如果文本适合按钮宽度,则不应有选取框效果。 我点击了一些链接(one
我正在从头开始实现 webgl 选取,并决定走 GLSL 路线,而不是光线相交测试。 所以我将整个场景渲染到一个单独的帧缓冲区中,为每个对象分配一个唯一的颜色,该颜色作为统一变量传递给片段着色器。当场
例如,我有包含多个对象的数组, var arr = ["a", "b", "c", "d"]; 我想要的是从该数组中选取 2 个随机对象,例如“a”和“c”,并将这 2 个对象推送到另一个数组中,例如
我是一名优秀的程序员,十分优秀!