使用CSS线性渐变

时间:2018-01-02 11:41:51

标签: css

我做了一个多色边框: https://codepen.io/Niavl/pen/vpmvmL

body {
  background: #333;
}

.my-div {
  text-align: center;
  position: relative;
  line-height: 100px;
  background: #fff;
  height: 100px;
  width: 100%;
}


/*border bottom*/

.my-div:after {
  background: linear-gradient(to right, transparent 45%, #87c846 45%, #87c846 60%, #e32b2d 60%, #e32b2d 70%, #ffc846 70%, #ffc846 95%, #847c6c 95%);
  position: absolute;
  content: '';
  height: 20px;
  right: 0;
  left: 0;
  bottom: -20px;
}
<div class="my-div">
  hello
</div>

我用于那个css线性渐变。

它可以工作,但它不干净,特别是在铬上:两种颜色之间有模糊。

有什么想让它更清洁?

0 个答案:

没有答案
相关问题