24

Span is not working in bootstrap v3.0.3.

 <div class="span4">    
        <div class="list-group">
        <a href="#" class="list-group-item active">Link</a>
        <a href="#" class="list-group-item">Link 1</a>
        <a href="#" class="list-group-item">Link 2</a>
        <a href="#" class="list-group-item">Link 3</a>
        <a href="#" class="list-group-item">Link 4</a>
        </div>
    </div>

2 Answers 2

50

span has become redundant in Bootstrap 3. It has now been replaced by col-xx-#, where xx can be lg, md, sm or xs and # ranges from 1 to 12. Read it up here.

Here's how your code should look like:

<div class="col-md-4">    
    <div class="list-group">
    <a href="#" class="list-group-item active">Link</a>
    <a href="#" class="list-group-item">Link 1</a>
    <a href="#" class="list-group-item">Link 2</a>
    <a href="#" class="list-group-item">Link 3</a>
    <a href="#" class="list-group-item">Link 4</a>
    </div>
</div>

Instead of md, you can use any of the above xx based on requirement.

4
  • Have there any alternative class? Dec 17, 2013 at 17:05
  • col-xx-# IS the alternate class.
    – Ranveer
    Dec 17, 2013 at 17:07
  • I would recommend you to read up the complete Bootstrap 3 documentation before proceeding. I too transitioned from 2.3.2 to 3 and there have been several changes in the classes.
    – Ranveer
    Dec 17, 2013 at 17:12
  • Thanks for your advice.I have worked with 2.3.2.Now for a project I have to work by 3.0.3.I am going to read full documentation. Dec 17, 2013 at 17:16
2

As Ranveer mentioned, Bootstrap 3 no longer uses span and instead you would use .col-xx-4 (with xx being the minimum viewport size for the sizing to take effect [xs, sm, md, lg]). Here is the link for the documentation for more information: http://getbootstrap.com/css/#grid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.