Yii2分页改变风格

时间:2016-09-04 13:57:41

标签: css pagination yii2

如何更改css以进行分页? 我有代码:

echo LinkPager::widget([
'pagination' => $pages,
'activePageCssClass'=>'act',
]);

并在我的CSS中扮演课程:

.act{
    color:red;
 }

但它不起作用。 我必须为它写什么选择?

1 个答案:

答案 0 :(得分:4)

这是Pagination的完整配置

<?php
LinkPager::widget([
    'pagination' => $pages,
    //Css option for container
    'options' => ['class' => ''],
    //First option value
    'firstPageLabel' => '&nbsp;',
    //Last option value
    'lastPageLabel' => '&nbsp;',
    //Previous option value
    'prevPageLabel' => '&nbsp;',
    //Next option value
    'nextPageLabel' => '&nbsp;',
    //Current Active option value
    'activePageCssClass' => 'p-active',
    //Max count of allowed options
    'maxButtonCount' => 8,

    // Css for each options. Links
    'linkOptions' => ['class' => ''],
    'disabledPageCssClass' => 'disabled',

    // Customzing CSS class for navigating link
    'prevPageCssClass' => 'p-back',
    'nextPageCssClass' => 'p-next',
    'firstPageCssClass' => 'p-first',
    'lastPageCssClass' => 'p-last',
]);