如何使用css,把div设置为一个椭圆容器,在做html页面开发时,我们一般都是使用div来做容器的,如果你需要一个椭圆形的容器,我们可以使用div来实现的,下面来看一下。......
html5 svg玫瑰花盛开动画特效
html5 svg玫瑰花盛开动画特效
工具/原料
- adobe dreamweaver
方法/步骤
新建html文档。
书写hmtl代码。center>
?xml version="1.0" encoding="utf-8"?>
svg id='svg' width='400px' viewBox="0 0 188 264">
defs>
radialGradient id="gradient-0" gradientUnits="userSpaceOnUse" cx="-107.308" cy="104.329" r="59.181" gradientTransform="matrix(0.261752, 0.411262, -0.686293, 0.596934, 160.094667, 49.38985)">
stop offset="0" style="stop-color: rgb(255, 0, 0);"/>
stop offset="1" style="stop-color: rgb(141, 41, 41);"/>
/radialGradient>
radialGradient id="gradient-1" gradientUnits="userSpaceOnUse" cx="113.342" cy="62.644" r="53.882" gradientTransform="matrix(-0.169507, 1.182475, -0.714039, -0.308382, 160.212434, -46.522622)">
stop offset="0" style="stop-color: rgb(255, 0, 0);"/>
stop offset="1" style="stop-color: rgb(141, 41, 41);"/>
/radialGradient>
radialGradient id="gradient-4" gradientUnits="userSpaceOnUse" cx="127.727" cy="116.674" r="45.581" gradientTransform="matrix(-0.468422, -1.651974, 0.962071, -0.272798, 74.446964, 391.898588)">
stop offset="0" style="stop-color: rgb(255, 0, 0);"/>
stop offset="1" style="stop-color: rgb(141, 41, 41);"/>
/radialGradient>
radialGradient id="gradient-6" gradientUnits="userSpaceOnUse" cx="43.926" cy="85.895" r="44.319" gradientTransform="matrix(1.145876, -0.154456, 0.133585, 0.991037, 18.521778, 10.448842)">
stop offset="0" style="stop-color: rgb(56, 16, 16);"/>
stop offset="1" style="stop-color: rgb(255, 0, 0);"/>
/radialGradient>
radialGradient id="gradient-7" gradientUnits="userSpaceOnUse" cx="70.257" cy="63.907" r="38.537" gradientTransform="matrix(-0.480251, 0.463812, -0.694689, -0.719311, 216.251059, 74.926092)">
stop offset="0" style="stop-color: rgb(255, 0, 0);"/>
stop offset="1" style="stop-color: rgb(141, 41, 41);"/>
/radialGradient>
radialGradient id="gradient-8" gradientUnits="userSpaceOnUse" cx="99.231" cy="116.778" r="19.209" gradientTransform="matrix(0.18829, -1.009689, 0.983052, 0.183324, -48.104751, 172.536193)">
stop offset="0" style="stop-color: rgb(51, 13, 13);"/>
stop offset="1" style="stop-color: rgb(255, 0, 0);"/>
/radialGradient>
/center>
书写css代码。
div{
margin: 0 auto;
}
body {
background-color: black;
}
#svg{
background-color: darkseagreen;
background: radial-gradient(darkseagreen 0%, black 70%);
width: 500px;
}
书写并添加js代码。script src="js/index.js">/script>
代码整体结构。
查看效果。
以上方法由办公区教程网编辑摘抄自百度经验可供大家参考!
标签: HTML
相关文章
- 详细阅读
- 详细阅读
-
HTML5创作工具,MAKA 2.0史上最全操作指南详细阅读
HTML5创作工具,MAKA 2.0史上最全操作指南,超过15000种模板组合。还怕你没有发挥的空间吗?MAKA(中文:码卡)作为中国最早推出移动端卡片式交互模式的创新者,随着HTML5技术的日渐成熟......
2023-03-16 435 HTML