【发布时间】:2017-02-01 18:48:27
【问题描述】:
我有一个随机生成到 div 的文本。并且此文本具有不同的宽度,具体取决于当前生成的内容。我希望此文本仅在太大时才显示。 html:
<div id="random_word"> <!--here appears something--> </div>
css:
#random_word {
color: white;
position: absolute;
width: 50%;
left: 0%;
text-align: center;
font-size: 8vw;
margin-top: 22%;
font-variant: small-caps
text-shadow: 0 0 20px #000;
text-align: center;
z-index: 2;
overflow: hidden;
white-space: nowrap;
line-height: 100%;
}
我已经在互联网上找到了这个 css 属性:overflow-x:-webkit-marquee;
但我不确定如何使用它。有人可以帮忙吗?
【问题讨论】: