SVG Button

Size
1,927 Kb
Views
40,480

How do I make an svg button?

Some baby steps into svg - reuse an element with xlink. What is a svg button? How do you make a svg button? This script and codes were developed by Matthias Dittgen on 26 August 2022, Friday.

SVG Button Previews

SVG Button - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SVG Button</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
</head>
<body> <svg width="500" height="500"> <defs> <linearGradient id="gradient" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:rgba(200, 200, 200, 0.2)" /> <stop offset="100%" style="stop-color:rgba(100, 100, 100, 1.0)" /> </linearGradient> <filter id="dropShadow" x="-10%" y="-25%" width="120%" height="150%"> <feOffset result="offOut" in="SourceAlpha" dx="2" dy="2" /> <feGaussianBlur result="blurOut" in="offOut" stdDeviation="3" /> <feBlend in="SourceGraphic" in2="blurOut" mode="normal" /> </filter> <g id="button"> <rect x="20" y="20" rx="10" ry="10" width="200" height="50" fill="url(#gradient)" stroke="rgba(0, 0, 0, 0.5)" stroke-width="1" opacity="0.5" filter="url(#dropShadow)"> </rect> <text x="120" y="55" font-family="Verdana" font-size="25" fill="rgb(90, 90, 90)" text-anchor="middle">SVG Button</text> </g> </defs> <use xlink:href="#button" x="120" y="0" /> <use xlink:href="#button" x="20" y="20" transform="scale(0.5)" />
</svg> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

SVG Button - Script Codes JS Codes

var bbox = buttonRemove.getBBox();
var width = bbox.width;
var height = bbox.height;
SVG Button - Script Codes
SVG Button - Script Codes
Home Page Home
Developer Matthias Dittgen
Username matths
Uploaded August 26, 2022
Rating 3
Size 1,927 Kb
Views 40,480
Do you need developer help for SVG Button?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Matthias Dittgen (matths) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!