css+js实现下拉选择导航条效果代码
代码语言:html
所属分类:菜单导航
代码描述:css+js实现下拉选择导航条效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap" rel="stylesheet"> <style> body { min-height: 100dvh; background: #fbfbfd; font-family: 'Inter', sans-serif; } body a { color: inherit; text-decoration: none; } body h1 { font: inherit; margin: 0; } body header { display: flex; align-items: center; gap: 1rem; background: #fff; border-bottom: 1px solid #eaedf3; } body header #identity { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1rem; padding-left: 1.5rem; margin-right: 1px; } body header #identity:after { content: ''; position: absolute; right: -1px; top: 25%; bottom: 25%; width: 1px; background: #eaedf3; } body header #identity img { height: 1.5rem; aspect-ratio: 1; } body header #identity h1 { line-height: 2.25rem; font-weight: 500; } body header nav { --width: 5.25rem; --height: 2.25rem; width: var(--width); height: var(--height); } body header nav .container { position: absolute; display: grid; grid-template-columns: var(--width) 0fr; grid-template-rows: var(--height) 0fr; border: 1px solid #eaedf3; b.........完整代码请登录后点击上方下载按钮下载查看
网友评论0