動畫的SVG,並將其設置爲背景
爲重要內容的問題:這是一個鏈接到yout展示瞭如何創建一個動畫與Adobe Illustrator的SVG圖像文件UBE教程(但並不必須這樣做的方式,用動畫的只是一個很好的例子):
youtube link tut on svg file creation and animation
這裏是動畫Mozilla的文檔使用所述animateTransform
元件例如:
Mozilla SVG animateTransform documentation
<?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>
配售SVG圖像作爲背景是很容易的:
codepen using callout with svg background-image
下面是一些HTML和CSS爲例:
<div class="svgEx marg">
<div class="row">
<div class="small-2 large-4 columns">Some text here.</div>
<div class="small-4 large-4 columns">Some more 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">Some more 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">Some more text here.</div>
<div class="small-6 large-4 columns">Even more text here.</div>
</div>
</div>
CSS:
.svgEx {
background: url(https://ohdoylerules.com/content/images/css3.svg) no-repeat center center;
min-height: 500px;
}
.marg { padding: 100px 0;}
真棒,謝謝!我不知道,你可以在HTML動畫! – Sean