Animated focus styles for kbd users
How do I make an animated focus styles for kbd users?
Animating outline (and outline-offset) can result in some eye-catching focus styles, hopefully helping keyboard users to identify which controls they are focusing.. What is a animated focus styles for kbd users? How do you make a animated focus styles for kbd users? This script and codes were developed by Heydon on 27 August 2022, Saturday.
Animated focus styles for kbd users - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated focus styles for kbd users</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Animated <code>:focus</code> styles for keyboard users</h1>
<p>Hint: You have to use the <kbd>TAB</kbd> key</p>
<button>Style 1</button>
<button>Style 2</button>
<button>Style 3</button>
</body>
</html>
Animated focus styles for kbd users - Script Codes CSS Codes
/* get rid of inner focus */
button::-moz-focus-inner,
input::-moz-focus-inner { border: 0; padding: 0;
}
/* generic button styles */
button { background: #5245F5; border: 0; font-size: 2em; margin: 0.5em; padding: 0.25em 1em; color: #fff; cursor: pointer; transition: 1.25s ease all; font-family: inherit;
}
/* bit of hover */
button:hover { background: #3F3889;
}
/* first animated focus style */
button:nth-of-type(1) { outline: thin dotted transparent; outline-offset: 1em;
}
button:nth-of-type(1):focus { outline-color: #222; outline-offset: 0.125em;
}
/* second animated focus style */
button:nth-of-type(2) { outline: thin solid transparent; outline-offset: 1em;
}
button:nth-of-type(2):focus { outline: 3px solid #222; outline-offset: 0;
}
/* third animated focus style */
button:nth-of-type(3) { outline: 1em solid transparent;
}
button:nth-of-type(3):focus { outline: 3px solid #3F3889; outline-offset: 0;
}
button:active { outline: none; position: relative; top: 2px;
}
/* just some layout */
body { text-align: center; font-size: 125%; font-family: georgia, serif; color: #222;
}
p { font-size: 1.5em;
}
kbd { font-weight: bold; background: #ccc; padding: 0.125em 0.33em; border-radius: 0.125em; box-shadow: 0 0.25em #999;
}
Developer | Heydon |
Username | heydon |
Uploaded | August 27, 2022 |
Rating | 4 |
Size | 1,987 Kb |
Views | 28,336 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Vue.js TODO List | 4,218 Kb |
Just add javascript | 2,010 Kb |
4 columns with padding | 1,576 Kb |
Focus management of smooth scrolling | 2,506 Kb |
CSS only, automated, and accessible external link icon | 1,678 Kb |
FUN TIMES Competition | 3,473 Kb |
File system with nested lists | 1,640 Kb |
Redesigned gender form field | 1,160 Kb |
Ransom Note With Google Font Subsets | 2,217 Kb |
Hash change logging | 2,134 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Break Out | AzazelN28 | 12,431 Kb |
Adding Items | Valhead | 4,008 Kb |
Horizontal slider on scroll | Alojzije | 2,672 Kb |
Pure CSS Tooltips | Mobius1 | 2,271 Kb |
Simple personal profile | Miroot | 2,856 Kb |
Experiments with Vertical Centering | KatieK2 | 3,924 Kb |
Cars going | Netoguimaraes | 1,699 Kb |
Stylize Stories | Jvhti | 2,465 Kb |
CSS Letter animations | Sladix | 2,116 Kb |
Materializecss input form | Jasonchan | 1,443 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!