【问题标题】:How can I make my vertical css marquee repeat我怎样才能让我的垂直css选框重复
【发布时间】: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 标记是无用的

【问题讨论】:

    标签: html css marquee


    【解决方案1】:

    /* 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

    更多例子是

    Horizontal marquee without white space and JS

    Vertical marquee without white space and JS

    【讨论】:

    • 我觉得你不理解我。我说你可以从this bad question删除你的赞成票,拜托。 ;-)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    • 2013-07-22
    • 2013-03-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多