如何防止旋转器内的图标旋转?

时间:2015-08-25 17:26:04

标签: css3 font-awesome

我创建了一个带有暂停图标的微调器。它此刻工作正常,但暂停图标似乎与旋转器的其余部分一起旋转。我不想让它旋转。但我希望带有橙色圆圈的旋转器能够保持旋转。我怎么样?

以下是plnkr

上的代码
    <span class="spinner fa-spin">
        <i class="fa fa-pause fa-inverse fa-lg">  </i>
    </span>


    <style>
      .spinner {
          height: 40px;
          width: 40px;
          position: absolute;
          top: 50%;
          left: 50%;
          margin: -20px -20px 0 0;
          border: 3px solid #F2B049;
          border-top: 3px solid #E6FFFC;
          border-left: 3px solid #E6FFFC;
          background-color: #1FBBA6;
          border-radius: 100%;
          text-align: center;
          line-height: 40px;
      }
    </style>

1 个答案:

答案 0 :(得分:1)

解决。这是plunkr及相关代码。如果您对如何改进这方面有任何建议,请告诉我。 :d

Correct: 
    <Br/>
    <div class="spinner-wrapper relative">
      <span class="spinner fa-spin inline-block" ></span>
      <div class="put-on-top">
        <i class="fa fa-pause fa-inverse fa-lg"></i>
      </div>
    </div>

    <style>
      .relative {
        position: relative;
      }
      .put-on-top {

        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        line-height: 45px;
        text-align: center;
      }
      .spinner-wrapper {

        display: inline-block;
      }
      .inline-block {
        display: inline-block;
      }
      .spinner {
          height: 40px;
          width: 40px;
          border: 3px solid #F2B049;
          border-top: 3px solid #E6FFFC;
          border-left: 3px solid #E6FFFC;
          background-color: #1FBBA6;
          border-radius: 100%;
          text-align: center;
          line-height: 40px;
      }