html - 如何仅使用css模糊除目标上的div以外的整个身体?
问题描述
我正在尝试做
<!DOCTYPE html>
<html>
<head>
<title>TEST</title>
<style>
:not(:target) {
filter: blur(5px);
}
</style>
</head>
<body>
<a href="#test">test</a>
</body>
</html>
但即使当我瞄准(点击)我的测试时,它也会变得模糊。
解决方案
试试这个:
body :not(:target) {
filter: blur(5px);
}
body :not(:target) {
filter: blur(5px);
}
<a href="#test">test</a>
<p id="test">This is Target</p>
<p>This is'nt Target</p>
推荐阅读
- c# - 将 json 有效负载转换为字符串
- python - 如何编写一行代码,用于在一行中用 27 个字符翻转硬币
- python - python中pandas数据的指数曲线拟合
- ios - startMonitoringSignificantLocationChanges 未立即启动
- tuples - 为什么我的语法是错误的?(TypeError:“元组”对象不可调用)
- javascript - 如何在 html 中使用 localStorage 保存表中的数据和行
- angular - Angular 根据从列表中动态选择的选项值显示或隐藏元素
- gdb - gdb的tui可以分成三个窗口吗?
- python - 在具有浮点边界的区间内查找整数时的舍入问题
- java - SearchView 不过滤项目