Skip to content

Instantly share code, notes, and snippets.

@patorash
Created April 5, 2017 01:26
Show Gist options
  • Save patorash/e852c80bc793d986866d5b5ebe2d3286 to your computer and use it in GitHub Desktop.
Save patorash/e852c80bc793d986866d5b5ebe2d3286 to your computer and use it in GitHub Desktop.
Bootstrap3でカラムを5分割する
.col-xs-1-5, .col-sm-1-5, .col-md-1-5, .col-lg-1-5,
.col-xs-2-5, .col-sm-2-5, .col-md-2-5, .col-lg-2-5,
.col-xs-3-5, .col-sm-3-5, .col-md-3-5, .col-lg-3-5,
.col-xs-4-5, .col-sm-4-5, .col-md-4-5, .col-lg-4-5 {
position: relative;
min-height: 1px;
padding-left: ($grid-gutter-width / 2);
padding-right: ($grid-gutter-width / 2);
}
@for $i from 1 through 4 {
.col-xs-#{$i}-5 {
float: left;
width: percentage($i / 5);
}
@media (min-width: $screen-sm-min) {
.col-sm-#{$i}-5 {
float: left;
width: percentage($i / 5);
}
}
@media (min-width: $screen-md-min) {
.col-md-#{$i}-5 {
float: left;
width: percentage($i / 5);
}
}
@media (min-width: $screen-lg-min) {
.col-lg-#{$i}-5 {
float: left;
width: percentage($i / 5);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment