css实现四种按钮悬停样式动画效果
代码语言:html
所属分类:悬停
代码描述:css实现四种按钮悬停样式动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css2?family=Orbitron&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Creepster&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Nixie+One&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Graduate&display=swap" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> :root { --btn-width: 150px; --btn-height: 75px; --first-btn-squeeze: 0.9; --deep-blue: #101048; --orange: #f29e04; --swamp: #239702; --deep-purple: #6f0397; --inactive-blue: #1a647d; --active-blue: #3fc6f4; --red: #d20404; --light-orange: #fff1c5; --yellow: #ffef02; --hot-pink: #ff0563; --default: 0.5s; --fast: 0.3s; --fastest: 0.2s; } *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; text-decoration: none; user-select: none; } html { font-size: 10px; } html, body { display: block; position: relative; width: 100%; height: 100%; } body { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; } .button-container { display: flex; align-items: center; justify-content: center; height: 50%; width: 50%; min-height: 200px; overflow: hidden; } .button-container:first-of-type { background-color: var(--deep-blue); } .button-container:nth-of-type(2) { background-color: var(--orange); } .button-container:nth-of-type(3) { background-color: var(--swamp); } .button-container:nth-of-type(4) { background-color: var(--deep-purple); } @media screen and (max-width: 650px) { .button-container { width: 100%; } } .button { display: flex; justify-content: center; align-items: center; height: var(--btn-height); width: var(--btn-w.........完整代码请登录后点击上方下载按钮下载查看
网友评论0