css变量实现响应式grid网格布局列表效果代码
代码语言:html
所属分类:响应式
代码描述:css变量实现响应式grid网格布局列表效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600&display=swap"); html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } body { background: #edf2f7; padding: 2rem; font-family: "Source Sans Pro", sans-serif; color: #4c4c4c; line-height: 1.5; } .easy-grid { display: grid; grid-gap: var(--g, 1rem); grid-template-columns: repeat(auto-fill, minmax(min(var(--m, 10rem), 100%), 1fr)); } .container { max-width: 1200px; margin: 0 auto; } .top { margin: 2rem auto 2rem; display: flex; flex-direction: column; justify-content: center; align-items: center; } .top p { text-align: center; max-width: 450px; width: 100%; } .top img { max-width: 700px; width: 100%; margin: 0 auto; } .top strong { font-weight: 600; } .top small { font-size: 0.7rem; position: relative; top: -1rem; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0