2015-08-25 63 views
1

我試圖渲染旁邊教授的名字一個RateMyProfessor標誌我創建使用CSS shape generatorCSS形狀具有形狀之間的空白

enter image description here

<td> 
    <i class="my-icon"><i></i><i></i><i></i><i></i></i> 
    <a 
     href= 
     "{{ URL_GOES_HERE 
     }}" 
     @if(
      $class->enroll === $class->max_enroll || 
      $class->enroll === "FULL" 
     ) 
      class="moreMuted" 
     @endif 
    > 
     <span class="instructor">{{ $class->instructor}}</span> 
    </a> 
</td> 

這是我的CSS :

.my-icon { 
    position: relative; 
} 
.my-icon > i { 
    position: absolute; 
    display: inline-block; 
    width: 7px; 
    height: 7px; 
    background-color: #26abe3; 
    left: 10.5px; 
    top: 0px; 
} 
.my-icon > i+i { 
    position: absolute; 
    display: inline-block; 
    width: 3.5px; 
    height: 3.5px; 
    background-color: #26abe3; 
    left: 7px; 
    top: 3.5px; 
} 
.my-icon > i+i+i { 
    position: absolute; 
    display: inline-block; 
    width: 0; 
    height: 0; 
    line-height: 0; 
    border: 1.75px solid #b3d237; 
    border-bottom: 1.75px solid #b3d237; 
    left: 7px; 
    top: 0px; 
} 
.my-icon > i+i+i+i { 
    position: absolute; 
    display: inline-block; 
    width: 7px; 
    height: 7px; 
    background-color: #b3d237; 
    left: 0px; 
    top: 0px; 
} 

.instructor { 
    margin-left: 20px; 
} 

但是,如果放大權,有形狀有很大差距:

enter image description here

只有當你縮小到150%,你沒有看到一個缺口。

所以我的問題是:

  1. 如何使類似的是,在所有縮放級別工作的一個圖標?

  2. 有沒有更好的方法來做到這一點?

我所做的以前是使他們的圖標(透明度)的.png,但由於該圖標不是一個向量,邊緣沒有像素完美的,非常模糊。所以我再次做了一個像素圖標在Photoshop中,保存爲PNG,但仍然模糊。

回答

0

其他解決方案是將您的標誌轉換爲SVG格式。