2014-02-11 4 views
2

IE와 Chrome에서 어떻게 동일한 결과 (반쪽 별)를 사용할 수 있습니까? 크롬에서CSS가있는 하프 스타

: http://jsfiddle.net/Auqj8/

.star { 
    font-size: x-large; 
    width: 50px; 
    display: inline-block; 
    color: gray; 
} 
.star:last-child { 
    margin-right: 0; 
} 
.star:before { 
    content: '\2605'; 
} 
.star.on { 
    color: gold; 
} 
.star.half:after { 
     content: '\2605'; 
     color: gold; 
     margin-left: -20px; 
     width: 10px; 
     position: absolute; 
     overflow: hidden; 
} 

IE에서 : http://jsfiddle.net/86pqx/

감사합니다.

+0

는 확실히하지만, 사파리에서 작동하지 않습니다. – royhowie

답변

5

이 모두 크롬에서 작동 IE

.star { 
    font-size: x-large; 
    width: 50px; 
    display: inline-block; 
    color: gray; 
} 
.star:last-child { 
    margin-right: 0; 
} 
.star:before { 
    content:'\2605'; 
} 
.star.on { 
    color: gold; 
} 
.star.half:after { 
    content:'\2605'; 
    color: gold; 
    position: absolute; 
    margin-left: -20px; 
    width: 10px; 
    overflow: hidden; 
} 

크롬 : http://jsfiddle.net/Auqj8/1/

IE : http://jsfiddle.net/86pqx/3/

+0

답장을 보내 주셔서 감사합니다. 작동하지 않습니다. 다음은 미리보기입니다. http://img239.imagevenue.com/img.php?image=081667879_Sanstitre_122_585lo.jpg –

+1

직장에서 사용하여 이것을 수정했습니다. .star 너비를 24로 설정하고 .star.half : 여백을 -24px, 너비를 12px로 설정하면 별이 올바르게 렌더링됩니다. –

+0

크기에 무관심한 것으로 고쳤습니다. http://jsfiddle.net/Auqj8/98/ – Shmiddty