div+css实现数字序号卡片效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现数字序号卡片效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.css"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wdth,wght@8..144,50..84,300..750&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&display=swap" rel="stylesheet"> <style> * { box-sizing: border-box; } :root { --color-lime: #dae470; --color-teal: #009ba4; --color-purple: #8b67ac; --color-yellow: #ffe600; --color-pink: #e585c6; --color-lightblue: #80bfff; --color-black: #000; --color-white: #fff; --color-gray: #545454; --gradient-lightblue-teal: linear-gradient( 0deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100% ), radial-gradient( 81.34% 70.71% at 100% 0%, rgba(255, 230, 0, 0.4) 0%, rgba(255, 230, 0, 0) 100% ), linear-gradient(53deg, var(--color-lightblue) 0%, var(--color-teal) 102.3%); --gradient-pink-yellow: linear-gradient( 0deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100% ), radial-gradient( 81.34% 70.71% at 100% 0%, rgba(248, 235, 84, 0.8) 0%, rgba(248, 235, 84, 0) 100% ), linear-gradient(307deg, var(--color-yellow) 1.91%, var(--color-pink) 98.08%); --gradient-lime-teal: linear-gradient( 0deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100% ), radial-gradient( 81.34% 70.71% at 100% 0%, rgba(255, 230, 0, 0.5) 0%, rgba(255, 230, 0, 0) 100% ), linear-gradient(110deg, var(--color-lime) 0.84%, var(--color-teal) 132.41%); --gradient-purple-pink: linear-gradient( 0deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100% ), radial-gradient( 81.34% 70.71% at 100% 0%, rgba(128, 191, 255, 0.5) 0%, rgba(128, 191, 255, 0) 100% ), linear-gradient(307deg, var(--color-pink) 1.91%, var(--color-purple) 98.08%); } body { font-family: "Roboto Flex", sans-serif; } .service-cards-grid { list-style-type: none; display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; margin: 0; padding: 0; } @media screen and (min-width: 60em) { .service-cards-grid { grid-template-columns: 1fr 1fr; } } .service-card-wrapper { background: var(--gradient); container-name: service-card; container-type: inline-size; overflow: clip; } .service-card { padding: 2rem 1.5rem; padding-inline-start: clamp(1.5rem, -9.3rem + 54cqi, 15rem); position: relative; height: 100%; min-height: clamp(12.5rem, 2.5rem + 50cqi, 25rem); background: var(--gradient); display: flex; align-items: center; } .service-card svg { position: absolute; inset: -3%; height: 106%; width: 110%; z-index: 1; opacity: 0.5; } .service-card__content { max-width: clamp(25rem, 13.636rem + 36.36cqi, 30rem); margin-inline: auto; z-index: 2; position: relative; } .service-card__content > * + * { margin-block-start: 1em; } .service-card__title { font-size: max(1.0179rem + 4.5cqi, 1.625rem); font-variation-settings: "wght" 750, "wdth" 50; letter-spacing: 0.04em; line-height: 1; text-transform: uppercase; } .service-card__subline { font-size: max(0.875rem, 0.8393rem + 0.4vw); line-height: 1.5; } @container service-card (min-width: 45rem) { .service-card { background: linear-gradient(85deg, #000 10.97%, rgba(0, 0, 0, 0) 40.2%), var(--gradient); background-blend-mode: overlay, normal, normal; } .service-card svg { opacity: 1; } } h1, h2, h3, h4, p { margin: 0; } </style> </head> <body> <ul class="grid-switcher service-cards-grid" role="list"> <li class="service-card-wrapper"> <article class="service-card" style="--gradient:var(--gradient-lightblue-teal)"> <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 201 404" preserveAspectRatio="xMinYMid meet"> <path d="m95.4787 1.5h103.4113v400.564h-103.5961v-313.0015-2.2352l-2.0684.847-91.7255 37.5607v-85.5389z" stroke="#fff" stroke-width="3"></path> </svg> <div class="service-card__content"> <h3 class="service-card__title | uppercase">Mentoring</h3> <p class="service-card__subline">Unsere erfahrenen Mentor*innen bieten dir vertrauliche und personalisierte Unterstützung bei der Jobsuche, deiner persönlichen Weiterentwicklung, beim Outing am Arbeitsplatz und vielem mehr.</p> </div> </article> </li> .........完整代码请登录后点击上方下载按钮下载查看
网友评论0