Search code examples
yii2yii2-basic-app

Yii2 breadcrumb not showing


Here's the code to show breadcrumb on my view

<div class="container">
    <?= Breadcrumbs::widget([
        'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
    ]) ?>
    <?= $content ?>
</div>

But when I change div class to "container-fluid" the breadcrumb not showing anymore and I really don't know why? I'm new to Yii2.

Please help me with this.

Sorry for my bad English. Thank you.


Solution

  • The problem is with padding. The .container class (inside .wrap) has padding: 70px 15px 20px; what gives enough padding top for the breadcrumbs to be shown below the top navbar .The container-fluid class has no padding and the breadcrumbs lie behind the top navbar. Add padding-top: 70px to your .container-fluid class and you will see your breadcrumbs again.