twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.47k stars 78.83k forks source link

Flow of spans within accordion-heading #2466

Closed codeofthewoosters closed 12 years ago

codeofthewoosters commented 12 years ago

First things first, congratulations on a great project so far!

Now for the question:

I've been trying to split an "accordion-heading" within the "accordion-group" into two spans of size 4 each. The accordion is of span8. However, I find that the second span drops down into a new row. Can someone please point out whether this is the correct behaviour for this layout? I've included the code taken from the example documents.

Cheers.

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="assets/css/bootstrap.css" rel="stylesheet">
    <link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="assets/css/docs.css" rel="stylesheet">
</head>
<body>       
    <div class="container">
        <section>         
            <div class="span8 show-grid">
                <div class="accordion">
                    <div class="accordion-group">
                        <div class="row">
                            <div class="accordion-heading span4">
                                <div class="accordion-toggle">  
                                    <span>Accordion heading of span 4</span>
                                </div>
                            </div>
                            <div class="accordion-heading span4">
                                <div class="accordion-toggle">
                                    <span>Accordion heading of span 4 (should this be in a new line?)</span>                                
                                </div>
                            </div>
                        </div>
                        <div id="collapseTwo" class="accordion-body collapse">
                            <div class="accordion-inner">
                                Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                            </div>
                        </div>
                    </div>                 
                </div>
            </div>
        </section>

    </div>

    <script src="assets/js/bootstrap-collapse.js"></script>
    <script src="assets/js/application.js"></script>
</body>
mdo commented 12 years ago

You need to wrap any set of .span* classes with a .row just like we do in our docs. Add .row to your section and you should be fine.