I recently started using Twitter Bootstrap and I can’t seem to grasp what spans do and why are there different numbered spans, like span4, span12? And what are offsets and when are they used? (Sometimes used with spans) I tried to search it online, but only found specific questions about bootstraps.
Share
The Bootstrap “span” classes are used in the bootstrap grid system.
The documentation shows columns labelled with numbers, each number represents the
spanclass used for this container. Offset are shown right in the next section, they define how many empty columns should be to the left of the span.You can read
span4 offset2as “extend this block over 4 columns, leave two columns empty to the left”.By default there are 12 columns. If you have a
span12, it will be as wide as the container (which may be fluid).This is relevant for v3.2.2, which is no longer supported. The up-to-date version of Bootstrap can be found here.
If you are looking for the ‘span’ class in Bootstrap in v4 (which refers to badges and labels instead of the grid system), this can be found here.