SVG ·ÅÉäÐÔ½¥±ä
SVG ½¥±ä±ØÐëÔÚ <defs> ±êÇ©ÖнøÐж¨Òå¡£
·ÅÉäÐÔ½¥±ä
<radialGradient> ÓÃÀ´¶¨Òå·ÅÉäÐÔ½¥±ä¡£
<radialGradient> ±êÇ©±ØÐëǶÌ×ÔÚ <defs> ÖС£<defs> ±êÇ©ÊÇ definitions µÄËõд£¬ËüÔÊÐí¶ÔÖîÈç½¥±äµÈÌØÊâÔªËØ½øÐж¨Òå¡£
Çë°ÑÏÂÃæµÄ´úÂ뿽±´µ½¼Çʱ¾£¬È»ºó°ÑÎļþ±£´æÎª "radial1.svg"¡£°Ñ´ËÎļþ·ÅÈëÄúµÄ web Ŀ¼£º
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <radialGradient id="grey_blue" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(200,200,200); stop-opacity:0"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:1"/> </radialGradient> </defs> <ellipse cx="230" cy="200" rx="110" ry="100" style="fill:url(#grey_blue)"/> </svg>
´úÂë½âÊÍ£º
<radialGradient> ±êÇ©µÄ id ÊôÐÔ¿ÉΪ½¥±ä¶¨ÒåÒ»¸öΨһµÄÃû³Æ£¬fill:url(#grey_blue) ÊôÐÔ°Ñ ellipse ÔªËØÁ´½Óµ½´Ë½¥±ä£¬cx¡¢cy ºÍ r ÊôÐÔ¶¨ÒåÍâȦ£¬¶ø fx ºÍ fy ¶¨ÒåÄÚȦ ½¥±äµÄÑÕÉ«·¶Î§¿ÉÓÉÁ½ÖÖ»ò¶àÖÖÑÕÉ«×é³É¡£Ã¿ÖÖÑÕɫͨ¹ýÒ»¸ö <stop> ±êÇ©À´¹æ¶¨¡£offset ÊôÐÔÓÃÀ´¶¨Òå½¥±äµÄ¿ªÊ¼ºÍ½áÊøÎ»Öá£ÁíÒ»¸öÀý×Ó£º
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <radialGradient id="grey_blue" cx="20%" cy="40%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(200,200,200); stop-opacity:0"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:1"/> </radialGradient> </defs> <ellipse cx="230" cy="200" rx="110" ry="100" style="fill:url(#grey_blue)"/> </svg>