div+css实现图片卡片列表鼠标悬停显示磨砂文字效果代码
代码语言:html
所属分类:悬停
代码描述:div+css实现图片卡片列表鼠标悬停显示磨砂文字效果代码果代码
代码标签: div css 图片 卡片 列表 鼠标 悬停 显示 磨砂 文字
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap"); @import url("https://fonts.googleapis.com/css2?family=Nosifer&display=swap"); * { margin: 0; padding: 0; box-sizing: border-box; } body { min-height: 100vh; display: flex; justify-content: center; align-items: center; background: #111; transition: 0.5s; font-family: "Poppins", sans-serif; font-weight: 400; font-style: normal; } body:has(.box[data-color=clr1]:hover) { background: #1f3729; } body:has(.box[data-color=clr2]:hover) { background: #301a15; } body:has(.box[data-color=clr3]:hover) { background: #1b2a32; } section { overflow: hidden; padding-top: 3em; } h2 { font-family: "Nosifer", sans-serif; font-weight: 400; font-style: normal; color: #db6724; font-size: clamp(2rem, 1rem + 4vw, 5rem); text-align: center; line-height: 1.3; } .container { position: relative; display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: wrap; padding: 3.25em 0 3em; } .container .box { position: relative; width: 300px; height: 300px; border-radius: 10px; display: flex; justify-content: center; align-items: center; transition: 0.5s; } .container .box .imgBox { position: absolute; inset: 0; border-radius: 12px; border: 4px solid rgba(0, 0, 0, 0.2); } .container .box .imgBox img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: 0.5s; border-radius: 10px; } .container .box .glass { position: absolute; inset: 0; background: linear-gradient(#fff2, transparent); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 15px 15px rgba(0, 0, 0, 0.25); backdrop-filter: blur(15px); border-radius: 10px; overflow: hidden; scale: 0; display: flex; justify-content: center; align-items: center; transition: 0.5s; opacity: 0; } .container .box .glass:before { position: absolute; content: ""; bottom: 0; width: 100%; height: 40px; background: rgba(255, 255, 255, 0.05); } .container .box .glass h3 { font-size: 1.25rem; color: #fff; text-transform: uppercase; letter-spacing: 0.1em; text-align: center; line-height: 0.8em; font-weight: 500; } .container .box .glass span { font-size: 0.5em; font-weight: 400; } .container .box .glass ul { position: absolute; bottom: 0; width: 100%; display: flex; justify-content: center; gap: 15px; } .........完整代码请登录后点击上方下载按钮下载查看
网友评论0