纯css实现导航菜单效果
代码语言:html
所属分类:菜单导航
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body{ padding: 50px; } :root{ --sizeVar: 10vh; } .backDiv { position: relative; width: calc(var(--sizeVar) * 2); height: calc(var(--sizeVar) * 2); float: left; margin: calc(var(--sizeVar) / 3); overflow: hidden; color: #861657; font-size: var(--sizeVar); text-align: center; border-radius: calc(var(--sizeVar) / 10); line-height: calc(var(--sizeVar) * 2); -webkit-animation: unselectAnim 300ms ease-in-out forwards; animation: unselectAnim 300ms ease-in-out forwards; -webkit-transition: box-shadow 200ms ease-in 0; transition: box-shadow 200ms ease-in 0; } .backDiv::before, .backDiv::after { color: white; font-size: calc(var(--sizeVar) * 1.5); text-align: center; line-height: calc(var(--sizeVar) * 4); position: absolute; width: 200%; height: 200%; top: -50%; left: -50%; } .backDiv::before { content: ""; border-radius: 50%; background-color: #861657; background-image: linear-gradient(326deg, #861657 0%, #ffa69e 74%); -webkit-transform: scale(0); transform: scale(0); -webkit-transition: -webkit-transform 300ms ease-in; transition: -webkit-transform 300ms ease-in; transition: transform 300ms ease-in; transition: transform 300ms ease-in, -webkit-transform 300ms ease-in; } .backDiv::after { content: "☆"; opacity: 0; -webkit-transition: opacity 400ms linear; transition: opacity 400ms linear; } #link_02::after { content: "♘"; } #link_03::after { content: "❀"; } #link_04{ clear: left; } .backDiv:target{ -webkit-animation: selectedAnim 500ms ease-in-out forwards; animation: selectedAnim 500ms ease-in-out forwards; box-shadow: 0 5.2px 3.6px rgba(0, 0, 0, 0.021), 0 14.3px 10px rgba(0, 0, 0, 0.03), 0 34.4px 24.1px rgba(0, 0, 0, 0.039), 0 114px 80px rgba(0, 0, 0, 0.06); -webkit-transition: box-shadow 200ms ease-out 300ms; transition: box-shadow 200ms ease-out 300ms; } #link_02:target{ -webkit-animation: selectedAnim_2 500ms ease-in-out forwards; animation: selectedAnim_2 500ms ease-in-out forwards; } .backDiv:target::before { -webkit-transform: scale(1); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0