我正在尝试设置焦点时的字段轮廓样式,因为我当前的轮廓很难看清。我知道一些 html 元素默认是可聚焦的,所以我不太确定要附加大纲样式的元素。
我是否需要针对所有潜在的可聚焦元素?喜欢
a:focus, button:focus {outline: 1px solid white; }
Run Code Online (Sandbox Code Playgroud)
(包括所有其他元素)?这似乎不是正确的方法。
我试过寻找答案,我能找到的只是大纲一定不能,none但除此之外,我还没有找到其他任何东西。
我正在开发PWA,我在我的网站上安装并激活了一名服务人员.它在本地服务器上进行测试时运行良好,但是当我实时发送代码时,它会失败.
这是我的SW:
const cacheName = 'v1';
const cacheFiles = [
'/',
'/css/styles.css',
'/images/test1.png',
'/images/test2.png',
'/js/app.js',
'/js/sw-registration.js'
]
// Install event
self.addEventListener('install', function(event) {
console.log("SW installed");
event.waitUntil(
caches.open(cacheName)
.then(function(cache){
console.log('SW caching cachefiles');
return cache.addAll(cacheFiles);
})
)
});
// Activate event
self.addEventListener('activate', function(event) {
console.log("SW activated");
event.waitUntil(
caches.keys()
.then(function(cacheNames){
return Promise.all(cacheNames.map(function(thisCacheName){
if(thisCacheName !== cacheName){
console.log('SW Removing cached files from', thisCacheName);
return caches.delete(thisCacheName);
}
}))
})
)
});
// Fetch event
self.addEventListener('fetch', function(event) {
console.log("SW fetching", event.request.url);
event.respondWith(
caches.match(event.request)
.then(function(response){
console.log('Fetching new files'); …Run Code Online (Sandbox Code Playgroud)