html - 大纲只能使用焦点修改
问题描述
我有一个动画:尝试安装,但outline:none
可能是它不起作用的原因。来自 css 的错误消息:outlines should only be modified using focus.
当页面上应该有一个电灯开关时,目前只有一个带有文本的灰色页面:https ://adsler.co.uk/privacy-policy/ 。可能不是那样,而是试图打折所有选项,它被列为 css 错误。
CSS:
*,
*::before,
*::after {
box-sizing: border-box;
}
body,
html {
height: 100%;
font-weight: 500px;
font-family: 'Titillium Web', sans-serif;
background: #eee;
}
[type="checkbox"] {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transition: all .05s ease-in-out;
width: 80px;
height: 110px;
z-index: 2;
opacity: 0.001;
cursor: pointer;
-webkit-appearance: none;
-webkit-tap-highlight-color: transparent;
outline: none;
}
[type="checkbox"] ~ .switch {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transition: all .05s ease-in-out;
width: 80px;
height: 110px;
border-radius: 12px;
background: linear-gradient(to bottom, #d2d4d6, #fff);
box-shadow: inset 0 -2px 4px rgba(212, 205, 199, 0.75),
inset 0 -8px 0 1px rgba(156, 156, 157, 0.85),
0 0 0 1px rgba(116, 116, 118, 0.8),
0 6px 6px rgba(41, 41, 41, 0.3),
0 0 0 4px #d4d7d8;
filter: contrast(1);
}
[type="checkbox"] ~ .switch::before,
[type="checkbox"] ~ .switch::after {
content: 'on';
position: absolute;
left: 0;
bottom: 11px;
color: rgba(0, 0, 0, 0.5);
font-size: 20px;
width: 100%;
text-align: center;
text-transform: uppercase;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
transition: all .05s ease-in-out;
}
[type="checkbox"] ~ .switch::after {
content: 'off';
bottom: auto;
top: 5px;
color: rgba(0, 0, 0, 0.45);
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
[type="checkbox"]:checked ~ .switch {
background: linear-gradient(to bottom, #a1a2a3, #f0f0f0);
box-shadow: inset 0 2px 4px rgba(212, 205, 199, 0.75),
inset 0 8px 0 1px rgba(255, 255, 255, 0.77),
0 0 0 1px rgba(116, 116, 118, 0.8),
0 -2px 2px rgba(41, 41, 41, 0.18),
0 0 0 4px #d4d7d8;
filter: none;
}
[type="checkbox"]:checked ~ .switch::before {
bottom: 3px;
color: rgba(0, 0, 0, 0.5);
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
[type="checkbox"]:checked ~ .switch::after {
top: 13px;
color: rgba(0, 0, 0, 0.45);
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}
[type="checkbox"] ~ .light {
background: #0a0a16;
opacity: 0.7;
top: 0;
left: 0;
width: 100%;
height: 100%;
mix-blend-mode: multiply;
pointer-events: none;
z-index: 2;
}
[type="checkbox"]:checked ~ .light {
opacity: 0;
}
html:
<input type="checkbox"
checked="checked" />
<div class="switch"></div>
<div class="light"></div>
还unknown property
得到mix-blend-mode
?
解决方案
推荐阅读
- graphql - CraftQL - 无法在矩阵字段中找到标签字段
- node.js - 如何将 req.params 传递/使用到前端 js
- javascript - 这两个不同的代码如何返回相同的结果
- php - 使用 SimpleXml 从 xml 文件中提取数据
- c++ - PCL:如何从 PCL 1.8.1 中的 k-means 聚类中提取聚类标签?
- json - 如果多个键具有指定值,则使用 jq 返回布尔值
- django - Django 超级用户创建无响应
- java - 当我运行'cordova build android'时,我不断收到“无法运行”javac -version””
- jquery - 如何在 django 中使用 jquery 更改多个图像 src
- java - 迭代所有无平方复合材料 < L