Skip to content

Instantly share code, notes, and snippets.

@terrierscript
Last active February 15, 2016 10:48
Show Gist options
  • Select an option

  • Save terrierscript/45d5b58ae9c54383f9b2 to your computer and use it in GitHub Desktop.

Select an option

Save terrierscript/45d5b58ae9c54383f9b2 to your computer and use it in GitHub Desktop.
svgで半分の星を如何にして再現するか ref: http://qiita.com/inuscript/items/fbe1c302879e69c9a7ef
.rating-star .half{
fill: orange;
color: gray;
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<svg width="16" height="16" viewBox="0 0 16 16">
<!-- left -->
<svg
width="8" height="16"
preserveAspectRatio="slice xMinYMin">
<use xlink:href="star.svg#star" fill="orange" />
</svg>
<!-- right -->
<svg
x="8"
width="8" height="16"
preserveAspectRatio="slice xMaxYMax">
<!-- x位置をずらす -->
<use x="-8" xlink:href="star.svg#star" fill="#ddd" />
</svg>
</svg>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<svg width="16" height="16" viewBox="0 0 16 16">
<use xlink:href="star.svg#star" fill="orange" />
<svg width="8" height="16" viewBox="0 0 8 16" x=8>
<use x="-8" xlink:href="star.svg#star" fill="#ddd" />
</svg>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment