Bring Life to Your SVG by Using Animation Effects
The Key Information for Your Query: Check out this helpful YouTube tutorial that demonstrates how to animate an SVG image using Adobe Illustrator (although there are other methods available as well):
Tutorial on Creating and Animating SVG Files
Additionally, Here is the Mozilla Guide on Incorporating Animation specifically utilizing the animateTransform
element:
Mozilla's Documentation on SVG animateTransform
<?xml version="1.0"?>
<svg width="120" height="120" viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" >
<polygon points="60,30 90,90 30,90">
<animateTransform attributeName="transform"
attributeType="XML"
type="rotate"
from="0 60 70"
to="360 60 70"
dur="10s"
repeatCount="indefinite"/>
</polygon>
</svg>
Incorporating an SVG Image as a Background Is Simple:
Example of CodePen with SVG Background Image
Below is HTML and CSS provided as a demonstration:
<div class="svgEx marg">
<div class="row">
<div class="small-2 large-4 columns">Add text here.</div>
<div class="small-4 large-4 columns">More text goes here.</div>
<div class="small-6 large-4 columns">Even more text over here.</div>
</div>
<div class="row">
<div class="small-2 large-4 columns">Insert text here.</div>
<div class="small-4 large-4 columns">Additional text here.</div>
<div class="small-6 large-4 columns">Even more text here.</div>
</div>
<div class="row">
<div class="small-2 large-4 columns">Some text here.</div>
<div class="small-4 large-4 columns">Extra text here.</div>
<div class="small-6 large-4 columns">Even more text here.</div>
</div>
</div>
CSS Styling:
.svgEx {
background: url(https://ohdoylerules.com/content/images/css3.svg) no-repeat center center;
min-height: 500px;
}
.marg { padding: 100px 0;}