Skip to content

Instantly share code, notes, and snippets.

/**
* ...
*/
.container { width: 100%; background: red; }
ul { background: white; display: inline-block; position: relative; margin: 0 0 0 200px; }
ul:before { content: ''; display: block; width: 200px; height: 100%; position: absolute; left: -200px; background: white; }
@stijnj
stijnj / dabblet.css
Created January 10, 2013 15:37
Waarom is de lijn onder de tekst niet rood?
/**
* Waarom is de lijn onder de tekst niet rood?
*/
h2 { color: red; }
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:18
Floats: clearfix
/**
* Floats: clearfix
*/
div {
width: 200px;
border: 1px solid black;
}
span {
float: left;
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:13
Floats
/**
* Floats
*/
.foo {
float: left;
}
.bar {
float: right;
}
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:03
Position: fixed
/**
* Position: fixed
*/
.bar {
position: fixed;
left: 20px;
top: 50px;
width: 100px;
background: blue;
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:02
Position: relative + absolute
/**
* Position: relative + absolute
*/
.bar {
position: absolute;;
left: 20px;
top: 20px;
width: 100px;
background: blue;
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:01
Position: relative
/**
* Position: relative
*/
.bar {
position: relative;
left: 20px;
top: 20px;
width: 100px;
background: blue;
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:00
Position: absolute
/**
* Position: absolute
*/
.bar {
position: absolute;
right: 0;
top: 0;
width: 100px;
background: blue;
@stijnj
stijnj / dabblet.css
Created December 19, 2012 21:00
Position: static
/**
* Position: static
*/
.bar {
position: static;
width: 100px;
background: blue;
color: #fff;
}
@stijnj
stijnj / dabblet.css
Created December 19, 2012 20:57
Box-model: content-box vs. border-box
/**
* Box-model: content-box vs. border-box
*/
div {
width: 300px;
border: 1px solid black;
}
span {
box-sizing: border-box;
display: inline-block;