如何用css3做弹幕

html-css08

如何用css3做弹幕,第1张

1.首先创建弹幕区域

<div class="barrage"><div class="mask"><!--//弹幕内容--></div></div><input type="text" ng-model="data.comment"/><button ng-click="addDanmu()">说两句</button >

2.css

.webPage .barrage{width:100%height:22%position: absolutebottom: 50pxbackground-color: transparentpointer-events: none}.webPage .barrage .mask{width:100%height:100%background:transparentz-index:100}

设置对象被选择时的样式。 属伪类

<style>

p::-moz-selection{background:#000color:#f00}

p::selection{background:#000color:#f00}

</style>

<h1>选中下面的文字,看看它的颜色</h1>

<p>你选中这段文字后,看看它们的文本颜色和背景色,就能明白::的作用。</p>