【发布时间】:2020-06-18 16:04:36
【问题描述】:
我正在尝试制作一个没有任何空白/间隙的垂直选取框循环,但我似乎无法让它重复。我添加了aria-hidden="true",它在我的水平选框上工作,但这次似乎不是修复。
这是一个带选框的代码笔:https://codepen.io/theomarusman/pen/oNbBgej
this is the white space i want to remove
编辑:row 和 col 标记是无用的
【问题讨论】:
我正在尝试制作一个没有任何空白/间隙的垂直选取框循环,但我似乎无法让它重复。我添加了aria-hidden="true",它在我的水平选框上工作,但这次似乎不是修复。
这是一个带选框的代码笔:https://codepen.io/theomarusman/pen/oNbBgej
this is the white space i want to remove
编辑:row 和 col 标记是无用的
【问题讨论】:
/* Please try this instead */
body {
background-color: black;
}
.side-bar {
top: 0;
left: 0;
height: 100%;
color: white;
writing-mode: vertical-rl;
text-orientation: sideways-right;
}
.marquee p {
overflow: hidden;
white-space: nowrap;
height: 100%;
}
.marquee span {
animation: marquee 8s linear infinite;
display: inline-flex;
padding-right: 10px;
font-size: 4rem;
}
@keyframes marquee {
from {
transform: translateY(-100%);
}
to {
transform: translateY(0);
}
}
<div class="position-fixed side-bar">
<div class="row marquee">
<div class="col-12 bg-white">
<p class="m-0 p-0 p-3">
<span class="m-0 p-0 pb-4" aria-hidden="true">USE CODE "MLT"</span>
<span class="m-0 p-0 pb-4" aria-hidden="true">USE CODE "MLT"</span>
<span class="m-0 p-0" aria-hidden="true">USE CODE "MLT"</span>
</p>
</div>
</div>
</div>
.marquee {
overflow: hidden;
white-space: nowrap;
}
@keyframes marquee {
from {
transform: translateY(0);
}
to {
transform: translateY(100%);
}
}
此代码更改为以下内容。
.marquee p{
overflow: hidden;
white-space: nowrap;
height:100%;
}
@keyframes marquee {
from {
transform: translateY(-100%);
}
to {
transform: translateY(0);
}
}
在codepen中解决
https://codepen.io/Rayeesac/pen/OJMWMpm
更多例子是
【讨论】: