Skip to content

Instantly share code, notes, and snippets.

@csssecrets
csssecrets / dabblet.css
Last active September 30, 2021 21:35
Taming table column widths
/**
* Taming table column widths
*/
body { background: #ddd }
section {
width: 500px;
margin: 2em;
background: white;
@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
Created January 4, 2015 19:33
Multiple borders
/**
* Multiple borders
*/
div {
width: 100px;
height: 60px;
margin: 25px;
background: yellowgreen;
box-shadow: 0 0 0 10px #655,
@csssecrets
csssecrets / dabblet.css
Last active April 22, 2022 12:21
Flexible background positioning
/**
* Flexible background positioning
* via extended background-position
*/
div {
background: url(http://csssecrets.io/images/code-pirate.svg)
no-repeat bottom right #58a;
background-position: right 20px bottom 10px;
@csssecrets
csssecrets / dabblet.css
Created January 4, 2015 21:58
Flexible background positioning
/**
* Flexible background positioning
* via extended background-position
*/
div {
background: url(http://csssecrets.io/images/code-pirate.svg)
no-repeat bottom right #58a;
background-origin: content-box;
@csssecrets
csssecrets / dabblet.css
Created January 4, 2015 22:05
Flexible background positioning
/**
* Flexible background positioning
* via calc()
*/
div {
background: url(http://csssecrets.io/images/code-pirate.svg)
no-repeat bottom right #58a;
background-position: calc(100% - 20px) calc(100% - 10px);
@csssecrets
csssecrets / dabblet.css
Last active January 19, 2022 22:30
Horizontal stripes
/**
* Horizontal stripes
*/
background: linear-gradient(#fb3 50%, #58a 0);
background-size: 100% 30px;
@csssecrets
csssecrets / dabblet.css
Created January 13, 2015 07:57
Vertical stripes
/**
* Vertical stripes
*/
background: linear-gradient(to right, #fb3 50%, #58a 0);
background-size: 20px 100%;
@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 September 18, 2021 11:55
Diagonal stripes - repeating-linear-gradient() method
/**
* Diagonal stripes - repeating-linear-gradient() method
*/
background: repeating-linear-gradient(60deg,
#fb3, #fb3 15px,
#58a 0, #58a 30px);
height: 100%;