Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
Watch on YouTube · vikramsinghnegi
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By vikramsinghnegi
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 Watch on YouTube · vikramsinghnegi
Watch on YouTube · vikramsinghnegi is an animated CSS button by vikramsinghnegi. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, Icon
- 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
<button class="youtube-button">
<div class="svg-wrapper-1">
<div class="svg-wrapper">
<svg height="24" width="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"></path>
<path d="M1.946 9.315c-.522-.174-.527-.455.01-.634l19.087-6.362c.529-.176.832.12.684.638l-5.454 19.086c-.15.529-.455.547-.679.045L12 14l6-8-8 6-8.054-2.685z" fill="currentColor"></path>
</svg>
</div>
</div>
<span>Watch on YouTube</span>
</button>CSS
button.youtube-button {
font-family: inherit;
font-size: 18px;
background: linear-gradient(to bottom, #ff0000 0%, #ff5050 100%);
color: white;
padding: 0.8em 1.2em;
display: flex;
align-items: center;
justify-content: center;
border: none;
border-radius: 25px;
box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
transition: all 0.3s;
}
button.youtube-button:hover {
transform: translateY(-3px);
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.3);
}
button.youtube-button:active {
transform: scale(0.95);
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}
button.youtube-button span {
display: block;
margin-left: 0.4em;
transition: all 0.3s;
}
button.youtube-button svg {
width: 18px;
height: 18px;
fill: white;
transition: all 0.3s;
}
button.youtube-button .svg-wrapper {
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.2);
margin-right: 0.5em;
transition: all 0.3s;
}
button.youtube-button:hover .svg-wrapper {
background-color: rgba(255, 255, 255, 0.5);
}
button.youtube-button:hover svg {
transform: rotate(45deg);
}