Last Updated: February 25, 2016
·
839
· peiche

Handy CSS utility classes

These are my go-to styles for common use-cases (aside from the consistent box model, which I've put in another protip).

.hide {
    display: none;
}

.pull-left {
    float: left;
}
.pull-right {
    float: right;
}

.align-center {
    text-align: center;
}
.align-right {
    text-align: right;
}

.clearfix:before,
.clearfix:after {
    content:"";
    display:table;
}
.clearfix:after {
    clear:both;
}
.clearfix {
    zoom:1;
}