如何将图标移动到中心

时间:2017-06-22 10:31:45

标签: yii2 navbar

我有导航栏,代码在下面......

 <?php
        NavBar::begin(['brandLabel' => '',
                    'options' => [  //'class' => 'navbar-inverse navbar-fixed-top',
                                    'style' => 'height: 30px; margin-top:-10px;',]
                                ]);
        echo Nav::widget([
                    'items' => [['label' => 'Home', 'url' => ['/site/index']],
                                ['label' => 'About', 'url' => ['/site/about']],],
                    'options' => ['class' => 'navbar-nav','style' => 'align:center',],
                                ]);
        NavBar::end();
        ?>

是否可以将中殿图标移动到中心位置? bootstrap navbar-left,navbar-right正在运行correclty ..

2 个答案:

答案 0 :(得分:2)

这个应该可行,最好将内联css移动到某个类。

NavBar::begin(['brandLabel' => '',
                'options' => [  //'class' => 'navbar-inverse navbar-fixed-top',
                                'style' => 'height: 30px; margin-top:-10px;',]
                            ]);
    echo Nav::widget([
                'items' => [['label' => 'Home', 'url' => ['/site/index']],
                            ['label' => 'About', 'url' => ['/site/about']],],
                'options' => ['class' => 'navbar-nav','style' => 'display: flex;justify-content: center;float: none;',],
                            ]);
    NavBar::end();

答案 1 :(得分:0)

您可以在菜单中添加自己的ID

mouse_event

用css做任何你想做的事情

quesRef = myRef.child("questions").orderByChild("timestamp").endAt("120");