css实现自适应左侧粘性伸缩菜单效果代码
代码语言:html
所属分类:菜单导航
代码描述:css实现自适应左侧粘性伸缩菜单效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'> <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Material+Icons+Round'> <style> :root { --primary: 237, 94%, 81%; --background: 266, 16%, 92%; --background-secondary: 256, 12%, 12%; --background-secondary-dark: 256, 10%, 10%; --background-secondary-light: 257, 11%, 16%; --text-primary: 0, 0%, 0%; /* Colors */ --black: 0, 0%, 0%; --white: 0, 0%, 100%; --quite-gray: 0, 0%, 50%; --grooble: 10, 28%, 93%; /* Sizes */ --heading-large: 5.6rem; --heading-medium: 3.6rem; --heading-small: 2.4rem; --paragraph: 1.11rem; --navbar-buttons: 2.4rem; /* misc */ --transition-main: .175, .685, .32; /* Fonts */ --font-main: "Poppins"; } /* =========== Variabels =========== */ /* =============== Global Styles =============== */ *, *::before, *::after { box-sizing: inherit; } html, body { margin: 0; width: 100%; color: hsl(var(--text-primary)); font-family: var(--font-main); background-color: hsl(var(--background)); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; box-sizing: border-box; } /* ============ Typography ============ */ /* Headings */ h1, h2, h3, h4, h5, h6 { margin: 0; } /* Font Size */ h1 { font-size: var(--heading-large); } h2 { font-size: var(--heading-medium); } h3 { font-size: var(--heading-small); } h4 { font-size: calc(var(--heading-small) - .2rem); } h5 { font-size: calc(var(--heading-small) - .4rem); } h6 { font-size: calc(var(--heading-small) - .6rem); } /* Font Weight */ h1, h2 { font-weight: 900; } h3, h4, h5, h6 { font-weight: 800; } /* Paragraphs */ p { margin: 0; font-size: var(--paragraph); } /* Links */ a { color: hsla(var(.........完整代码请登录后点击上方下载按钮下载查看
网友评论0