D
D
dev4002016-03-18 21:35:12
HTML
dev400, 2016-03-18 21:35:12

How to center tabs?

7e0c24381f174846b4cf47e70243a2fa.png
They don't want to be centered. On the parent block, .center-block doesn't help

<div class="row">
        <div class="col-sm-12 center-block">
                            <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" href="#panel1">Панель 1</a></li>
                                <li><a data-toggle="tab" href="#panel2">Панель 2</a></li>
                                <li><a data-toggle="tab" href="#panel3">Панель 3</a></li>
                            </ul>

                            <div class="tab-content" style="border: 2px solid #c5c5c5;">
                                <div id="panel1" class="tab-pane fade in active">
                                    <h3>Панель 1</h3>
                                    <p>Содержимое 1 панели...</p>
                                </div>

                                <div id="panel2" class="tab-pane fade">
                                    <h3>Панель 2</h3>
                                    <p>Содержимое 2 панели...</p>
                                </div>

                                <div id="panel3" class="tab-pane fade">
                                    <h3>Панель 3</h3>
                                    <p>Содержимое 3 панели...</p>
                                </div>

                            </div>
                            
                        </div>
             </div>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry, 2016-03-18
@dev400

1. .nav-tabs- display: inline-block;
2. <div class="col-sm-12 center-block">set the classtext-center

T
ThunderCat, 2016-03-18
@ThunderCat

95a9d86df37749e7acc04a5f0268a3a0.png
Damn studio code!

W
Web Developer Blog, 2016-03-18
@Alexey_Suprun

just separate the panels into another block and center it :) it's a matter of two lines

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question