css background-image 画出横线

栗纸一:

1.css代码:

  .newsOneMobGreyLine{
    height: 3px;   // 可自定义
    background: url(../img/fFlower5.png);
  }

2. fFlower5.png   如下图(类似与一条倾斜的直线,画的丑忽略)


3. 最后效果:


栗纸二:

1.css

    background: url(../img/gray.jpg)bottom repeat-x;
    background-size: 100% 1px;

2.grey.jpg

一个1px的有颜色点。

3.效果:


猜你喜欢

转载自blog.csdn.net/weixin_42220533/article/details/80844715