Solved

SVG Star

Posted on 2016-11-22
4
14 Views
Last Modified: 2016-11-23
For the 5 points in SVG start, does it correspond to x, y coordination ?

Where does 0,0 refer ? Does it refer based on the width and height of the svg ?  Thx


<svg width="300" height="200">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>
0
Comment
Question by:AXISHK
  • 2
4 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
Comment Utility
This article https://en.wikipedia.org/wiki/Scalable_Vector_Graphics shows 0,0 to be the upper left corner of the SVG object.
0
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 250 total points
Comment Utility
Consider this progressive drawing of the star
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="0,0,100,10"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198 190,78"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198 190,78 10,78"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 

Open in new window

Renders like this
-ss95.jpgWorking sample here
0
 

Author Closing Comment

by:AXISHK
Comment Utility
Thx
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
You are welcome.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now