纯css实现一个蜡烛燃烧动画效果
代码语言:html
所属分类:动画
代码描述:纯css实现一个蜡烛燃烧动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { margin: 0; height: 100vh; display: flex; align-items: center; justify-content: center; background: black; } .candle { width: 15em; height: 30em; font-size: 7px; background: linear-gradient( orange, darkorange, sienna, saddlebrown 50%, rgba(0, 0, 0, 0.6) ); box-shadow: inset 2em -3em 5em rgba(0, 0, 0, 0.4), inset -2em 0 5em rgba(0, 0, 0, 0.4); border-radius: 10em / 4em; position: relative; display: flex; justify-content: center; top: 10em; } .candle::before { content: ''; position: absolute; width: inherit; height: 5em; border: 0.2em solid darkorange; border-radius: 50%; box-sizing: border-box; background: radial-gradient( #444, orange, saddlebrown, sienna, darkorange ); filter: opacity(0.7); } .thread { position: absolute; width: 0.6em; height: 3.6em; top: -1.8em; background: linear-gradient( #111, black, orange 90% ); border-radius: 40% 40% 0 0; } .flames { position: absolute; width: 2.4em; } .flames::before { content: ''; position: absolute; width.........完整代码请登录后点击上方下载按钮下载查看
网友评论0