Moving dotted border using CSS

后端 未结 8 1883
感情败类
感情败类 2020-12-08 10:57

I have class that applies a dotted style border property to a text block at runtime. I am trying to find a solution, using CSS, that makes the border move like a gif image.

8条回答
  •  孤街浪徒
    2020-12-08 11:24

    I've made a complete example based on this article. Enjoy!

    .outer {
      position: absolute;
      
      left: 100px;
      top: 50px;
      width: 100px;
      height: 100px;
      
      background-image: url(http://matthewjamestaylor.com/blog/selection.gif);
      
      border: 1px solid;
    }
    
    .selected {
      border: 0px;
    }
    
    .inner {
      position:absolute;
      bottom: 0;
      top: 0;
      left: 0;
      right: 0;
    
      background-color: #9CF;
    }
    
    .selected .inner {
      margin: 1px;
    }

提交回复
热议问题