svg + css
To argue that it is better to CSS or SVG absolutely not constructive.
This does not apply to a specific topic, but to the trend of requests to perform a particular task. Like this, - "Make me only on CSS or only on SVG"
It is necessary to use both. Both of these specifications have enough penetration into each other and work fine together.
Many are afraid of very long lines of SVG formulas, so I will try to make them in the style of CSS.
Took as a basis a good answer @ Gennady Zhurov and tried to make a mix of CSS+SVG
.solar-system { background-color: #002; width: 50%; height: 50%; } .sun { fill: yellow; filter: url(#dropShadow); } .mercury-orbit { stroke: rgba(255, 255, 255, .4); stroke-width: 1; fill: none; } .mercury { fill: crimson; filter: url(#dropShadow2); }
<div class="solar-system"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 400"> <defs> <filter id="dropShadow" x="-20%" y="-20%" width="150%" height="150%"> <feGaussianBlur stdDeviation="5" /> </filter> <filter id="dropShadow2" x="-20%" y="-20%" width="120%" height="120%"> <feGaussianBlur stdDeviation="2" /> </filter> </defs> <circle class="sun" cx="250" cy="175" r="25" /> <g> <animateTransform attributeName="transform" type="rotate" values="0 250 175;360 250 175" dur="12s" repeatCount="indefinite" /> <circle class="mercury-orbit" cx="250" cy="175" r="65" /> <circle class="mercury" cx="185" cy="175" r="6" /> </g> </div>
Related Topic: Animation of the Solar System Planets