Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
OnCloud125252's hover button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By OnCloud125252
Button submission checks
Checks will appear after the preview updates.
Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.
Accessibility quick check
Waiting for the rendered preview…
Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.
Explore freely here. Remix to publish your version with credit to the creator.
About OnCloud125252's hover button
OnCloud125252's hover button is an animated CSS button by OnCloud125252. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects
- Using this example
- Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.
Usage, Tailwind and licensing questions
Read the source files
HTML
<div tabindex="0" class="signInButton">
<p class="signInButtonText">Sign In</p>
</div>CSS
/* Note that you only needs to edit the config to customize the button! */
.signInButton {
/* Config start */
--signIn_width: 6rem;
--signIn_height: 2.5rem;
--signIn_bottomLeftTriangleSideLength: 1rem;
--signIn_topRightTriangleSideLength: 0.9rem;
/* Config end */
position: relative;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid white;
width: 6rem;
height: 2.5rem;
background-color: #000000;
overflow: hidden;
}
.signInButton::before {
position: absolute;
content: "";
bottom: 0;
left: 0;
width: 0;
height: 0;
border-width: 0 var(--signIn_bottomLeftTriangleSideLength) var(--signIn_bottomLeftTriangleSideLength) 0;
border-style: solid;
border-color: transparent transparent white transparent;
transition-timing-function: ease-in-out;
transition-duration: 0.2s;
}
.signInButton::after {
position: absolute;
content: "";
top: 0;
right: 0;
width: calc(var(--signIn_topRightTriangleSideLength) * 1.4142135623730950488016887242097);
height: calc(var(--signIn_topRightTriangleSideLength) * 1.4142135623730950488016887242097);
outline: 1px solid white;
transform: translate(50%, -50%) rotate(45deg);
transition-timing-function: ease-in-out;
transition-duration: 0.2s;
}
.signInButton:hover {
cursor: pointer;
}
.signInButton:hover::before {
--signIn_bottomLeftTriangleSideLength: calc(var(--signIn_width) + var(--signIn_height) - var(--signIn_topRightTriangleSideLength) + (var(--signIn_topRightTriangleSideLength) * 0.3));
}
.signInButton:focus-visible::before {
--signIn_bottomLeftTriangleSideLength: calc(var(--signIn_width) + var(--signIn_height) - var(--signIn_topRightTriangleSideLength) + (var(--signIn_topRightTriangleSideLength) * 0.3));
}
.signInButton:hover::after {
transform: translate(calc(50% + var(--signIn_topRightTriangleSideLength) * 0.1), calc((50% + var(--signIn_topRightTriangleSideLength) * 0.1) * -1)) rotate(45deg);
}
.signInButton:focus-visible::after {
transform: translate(calc(50% + var(--signIn_topRightTriangleSideLength) * 0.1), calc((50% + var(--signIn_topRightTriangleSideLength) * 0.1) * -1)) rotate(45deg);
}
.signInButton:hover>.signInButtonText {
color: black;
}
.signInButton:focus-visible>.signInButtonText {
color: black;
}
.signInButtonText {
margin: auto 0;
color: white;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 700;
text-align: center;
z-index: 1;
transition-timing-function: ease-in-out;
transition-duration: 0.2s;
}