GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing svg-tutorial.com — How to Draw Basic Paths with SVG - SVG Tutorial SVG Tutorial / The Path Element / Day 5 How to Draw Basic Paths with SVGOnce we covered basic shapes, it’s time to move on to the The shape of a path is defined by the Here we only have the two most basic commands, move-to and line-to. The move-to command moves the cursor to a point without drawing a line and the line-to command draws a straight line from the previous point. A command always continues the previous command. When we draw a line we only define the endpoint. The starting point will be the previous command’s endpoint. Hamburger menu iconBefore we get to the arrow example, let’s draw a simple hamburger menu icon. We draw three lines within the same path with the move-to ( -100, -100 200, 200 Then we continue and draw to more lines the same way. What is cool about paths, is that they don’t have to be continuous. We can have several move-to commands within the same path. The commas between the X and Y coordinates are optional. We skip them this time. -100, -100 200, 200 Icons like this often feel like noise on HTML. In a later chapter, we learn how to inline this icon in CSS and use it as you see it at the top left corner of this page. Heart shape iconHere’s another example made with a move to command and two line to commands. -100, -100 200, 200 In the example above if we reduce the value of the -100, -100 200, 200 Exercise: How would you do a full-screen icon?Did you know you can put not only videos on full screen but any other web elements as well? Click the icon below to see how it works. How would you do the full-screen icon below? Check out this YouTube tutorial to learn how. Hint: You can always right-click on an SVG in the browser, select Inspect, and check its source code. Click this icon to open this page in full screen Arrow iconThen to get to our example for today, we can draw an arrow in a very similar way. We start with a line in the middle, then we continue the line to draw the upper wing. -100, -100 200, 200 You might note that we also had a -100, -100 200, 200 Then we can finish the line with moving to the end of the horizontal line again, and drawing a straight line downwards to draw the lower wing of the arrow. You might notice that at the bottom of this and other pages in the navigation button we include a similar SVG. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |