Skip to content

Instantly share code, notes, and snippets.

@csssecrets
csssecrets / dabblet.css
Last active May 3, 2024 05:23
Text on a circle
/**
* Text on a circle
*/
body {
font: bold 120% Helvetica, sans-serif;
}
.circular {
width: 30em;
@csssecrets
csssecrets / dabblet.css
Last active October 21, 2023 12:46
Parallelograms — with pseudoelements
/**
* Parallelograms — with pseudoelements
*/
.button {
position: relative;
display: inline-block;
padding: .5em 1em;
border: 0; margin: .5em;
background: transparent;
@csssecrets
csssecrets / dabblet.css
Last active October 21, 2023 12:46
Diagonal stripes - linear-gradient() method
/**
* Diagonal stripes - linear-gradient() method
*/
background: linear-gradient(45deg,
#fb3 25%, #58a 0, #58a 50%,
#fb3 0, #fb3 75%, #58a 0);
background-size: 42.4px 42.4px;
@csssecrets
csssecrets / dabblet.css
Last active July 31, 2023 01:14 — forked from LeaVerou/dabblet.css
Interactive image comparison - with CSS resize
/**
* Interactive image comparison - with CSS resize
*/
.image-slider {
position:relative;
display: inline-block;
}
.image-slider > div {
@csssecrets
csssecrets / dabblet.css
Created January 4, 2015 15:17
Translucent borders
/**
* Translucent borders
*/
body {
background: url('http://csssecrets.io/images/stone-art.jpg');
}
div {
border: 10px solid hsla(0,0%,100%,.5);
@csssecrets
csssecrets / dabblet.css
Last active July 24, 2023 08:35
Vertical centering - absolute positioning method
/**
* Vertical centering - absolute positioning method
*/
main {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@csssecrets
csssecrets / dabblet.css
Created October 6, 2014 01:38
Typing animation
/**
* Typing animation
*/
@keyframes typing {
from { width: 0 }
}
@keyframes caret {
50% { border-right-color: transparent; }
@csssecrets
csssecrets / dabblet.css
Last active March 15, 2023 07:41
Bouncing animation
/**
* Bouncing animation
*/
@keyframes bounce {
60%, 80%, to {
transform: translateY(400px);
animation-timing-function: ease;
}
70% { transform: translateY(300px); }
@csssecrets
csssecrets / dabblet.css
Last active February 21, 2023 18:30
Flexible quarter ellipse
/**
* Flexible quarter ellipse
*/
div {
display: inline-block;
width: 16em;
height: 10em;
margin: 1em;
background: #fb3;
@csssecrets
csssecrets / dabblet.css
Last active February 20, 2023 09:57
Custom checkboxes
/**
* Custom checkboxes
*/
input[type="checkbox"] {
position: absolute;
clip: rect(0,0,0,0);
}
input[type="checkbox"] + label::before {