我有一个动画:尝试安装,但是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
吗?