css 实现毛玻璃
发表于|更新于|cssTricks
|总字数:161|阅读时长:1分钟|浏览量:
solution
- filter: blur(x px);
效果
123
tips
background-attachment: fixed;
使用此属性时 背景size和定位是依据向上查找到第一个属性为overflow: auto的父元素
文章作者: kshao
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 kshao-blog-前端知识记录!
相关推荐

2020-03-10
绝对定位-元素宽度自动撑开
.wrap { position: relative; margin: auto; height: 30px; width: 120px; margin-bottom: 50px; border: 1px solid blue; } .wrap > div { position: absolute; border: 1px solid; } .box-1 { left: 50%; transform: translateX(-50%); } 情景当父级出现定宽高情况下,子级绝对定位元素需要宽度撑开时。原场景 我是父级 100px 子元素-撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑撑 .box-1 { left: 50%; transform: translateX(-50%); } 1. width: max-content .wrap1 { z-index: 2; /*o...

2021-07-27
css 指定方向模糊 - 鸿蒙开机效果(animation 事件)
<svg> <filter id="blur"> <feGaussianBlur in="SourceGraphic" stdDeviation="0 2" /> </filter> </svg> 直截了当,没错是用 svg 来实现,其实 css 的样式与 svg 还是蛮接近的(一模一样) 效果使用 未使用(使用 blur) 鸿蒙开机效果<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>Title</title> </head> <style> body { margin: 0; height: 100vh; display: block; } .ct-circle-content { --circle-width: 100px; --circle-height: 100px; d...

2020-12-25
css 文字渐入效果,css 变量的进一步使用 setProperty
通过 js 修改 css 变量来更简单的实现动画效果,dom.style.setProperty 的使用 setPropertyconst a = document.querySelector('xx'); xx.style.setProperty(name, value); 顺带记一下获取的 // 该方法获取的值带 `单位` getComputedStyle(a).getPropertyValue('--x'); demo .iphoneText-wrap { margin: 100px auto; width: 400px; height: 400px; background-color: #000; overflow-y: auto; } .text { height: 300%; } .ihone-title { display: block; text-align: center; --x: 0%; position: sticky; top: 50%; transform: tra...

2023-07-19
【CSS】解决移动端(高清方案)下在谷歌浏览器中出现 字体大小布局异常,和设置的 font-size 不符(Text Autosizer、Font Boosting)
最近在谷歌浏览器调试移动端高清方案时,发现设置的字体大小竟然和实际显示的字体大小不一致?可以移动端 ua 打开此页面测试下方 demo。fontSize => 设置字体大小;actualSize => 实际展示字体大小 .font-boosting-wrap { } .font-boosting { } .font-boosting li { /*font-size: 22px;*/ } .font-boosting-size-wrap { font-size: 16px; /*text-size-adjust: none;*/ } .font-boosting-button { /*font-size: 22px;*/ } li 的 fontSize: fontSize: actualSize: auto set text-size-adjust ...

2020-03-13
css svg loading demo
本篇将记录一些 loading demo。 通过svg属性stroke-dashoffset 偏移和svg的差速旋转实现 loading 了解 stroke-dashoffsethttps://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/stroke-dashoffset loading-1效果 .svg-loading-wrap { margin: 10px auto 10px 10px; } .svg-loading-wrap .item .load { width: 75px; animation: loading 3s linear infinite; } .svg-loading-wrap .item .load #loading-inner { stroke-dashoffset: 0; stroke-dasharray: 300; stroke-width: 10; stroke-miterlimit: 10; stroke-linecap: round; anim...

2020-12-25
Css 模拟赛博朋克 故障风格 按钮
clip-path 和 step 的运用 记录。 .punk-wrap { display: flex; align-items: center; justify-content: center; width: 400px; height: 300px; margin: 100px auto; background-color: #F8F005; } .punk-btn, .punk-btn::after { position: relative; width: 150px; font-size: 25px; height: 40px; line-height: 40px; font-family: 'Bebas Neue', cursive; outline: none; border: none; ...
评论
公告
在线工具例如 获取 bdy key 等,可在线搜索哦~
最新文章





